question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging Winston Monitored Resource

See original GitHub issue

Environment details

  • OS: Ubuntu 16.04
  • Node.js version: v4.8.4
  • npm version: 2.15.11
  • google-cloud/logging-winston: 0.5.0

Hi there. 2 things that I noticed when trying out the Stackdriver transport for winston.

  1. The auto detection of monitored resource is not accurate. My node app is running on Google Compute Engine (GCE), but my logs appear in Google Container Engine (GKE). I am using PM2 to manage my node applications, could this be the cause?
  2. Since the auto detection above wasn’t working accurately, I tried specifying the monitored resource manually. The keys for labels seems to only take snake_case i.e. project_id and NOT camelCase projectId.
// Works
resource: {
  type: 'gce_instance',
  labels: {
    project_id: projectId,
    instance_id: instanceId,
    zone: zone,
  },
},

// Does not work. Nothing gets logged
resource: {
  type: 'gce_instance',
  labels: {
    projectId: projectId,
    instanceId: instanceId,
    zone: zone,
  },
},

I referred to the documentations here and here when specifying the key-value.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ofrobotscommented, Sep 11, 2017

Thanks for verifying. I have opened #2601 to deal with the zone label.

1reaction
ofrobotscommented, Aug 7, 2017

Thanks. I suspect this will be fixed by https://github.com/GoogleCloudPlatform/google-cloud-node/pull/2483. @stephenplusplus could we get a release for the base logging module followed by a dep-bump + release of logging-{winston,bunyan}?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interface Options (5.2.2) | Node.js client library
Serialize winston-provided log metadata using util.inspect . ... The monitored resource that the transport corresponds to.
Read more >
Winston Logger Ultimate Tutorial: Best Practices ...
Get an in-depth tutorial on Winston logging. Learn best practices for structuring your Node.js application so you can write easy and clean ...
Read more >
Complete Winston Logger Guide With Hands-on Examples
Logging is critical for monitoring and troubleshooting your Node.js project. The open-source Winston logger helps take a load off our ...
Read more >
Node.js Logging with Winston
Introducing Node Js Developers to Logging Using Winston Loggers. ... and connectivity issues are all resource-related issues to log.
Read more >
A Complete Guide to Winston Logging in Node.js
Want to centralize and monitor your Linux logs? Head over to Logtail and start ingesting your logs in 5 minutes. Getting started with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found