Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs not showing inside GKE #58

Closed
klaaz0r opened this issue Feb 19, 2020 · 3 comments
Closed

Logs not showing inside GKE #58

klaaz0r opened this issue Feb 19, 2020 · 3 comments
Labels
wontfix This will not be worked on

Comments

@klaaz0r
Copy link

klaaz0r commented Feb 19, 2020

🐛 Bug Report

I have everything setup correctly, secret with credentials etc. No errors are thrown but the actual logs are not showing up inside the stackdriver logging for my kubernetes containers

To Reproduce

Steps to reproduce the behavior:

pinoms({
    streams: [
      {
        stream: stackdriver.createWriteStream({
          logName: "NAME",
          projectId: "PROJECT_ID"
        })
      }
    ]
  });

Expected behavior

I want the logs to show up inside the actual container logs/kubernetes. Can this be a problem with missing labels?

Your Environment

  • Google Cloud Kubernetes Engine
@klaaz0r
Copy link
Author

klaaz0r commented Feb 20, 2020

I did some digging:

https://github.com/googleapis/nodejs-logging/blob/6f01c6679d7b4689ceb03011f37e4def5d9025f4/src/log.ts#L822

It looks like @google-cloud/logging by itself fetches the right labels if non are provided. But pino-stackdriver set's a default:

  const entry = {
    meta: {
      resource: resource || { type: 'global' },
      severity
    },
    data
  }

found here:

resource: resource || { type: 'global' },

Should this module default to { type: 'global' } or leave it to @google-cloud/logging? I am happy to create a PR

@ovhemert
Copy link
Owner

Is that only an issue you have with the resource.labels? Because if you do not provide anything to the module, it defaults to a resource of { type: 'global' }. But in that case resource.labels is still undefined. It only sets type.

@stale
Copy link

stale bot commented Apr 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 22, 2020
@stale stale bot closed this as completed Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants