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

how to get kubernetes information attached to log (google-cloud/logging-winston) #783

Open
hitzam-wartek opened this issue Feb 8, 2023 · 1 comment
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@hitzam-wartek
Copy link

Hi,

I just started to use (google-cloud/logging-winston) on my nodeJs service. I'm expecting to get full information on resource object on the log like this as on my dotnet service:

resource: {
	labels: {
		cluster_name: "staging-2"
		container_name: "service-api"
		location: "asia-southeast2"
		namespace_name: "be-tribe"
		pod_name: "service-api-staging-6798e57f9b-4xcmt"
		project_id: "mydotnetservice-staging"
	}
	type: "k8s_container"
}
severity: "WARNING"
timestamp: "2023-02-08T08:17:54.456124700Z"
}

I have tried this on my code (following this example):

const googleLoggingWinston = new LoggingWinston({
    serviceContext: {
        service: process.env.APPLICATION_NAME,
        version: 'staging',
    },
});

and these that all I got on the log:

resource: {
	labels: {
		project_id: "mynodeservice-staging"
	}
	type: "global"
}
severity: "INFO"
timestamp: "2023-02-08T08:33:27.161999940Z"
}

Anyone experienced the same issue?

@hitzam-wartek hitzam-wartek added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Feb 8, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging-winston API. label Feb 8, 2023
@losalex losalex assigned losalex and unassigned daniel-sanche Feb 8, 2023
@losalex losalex removed their assignment Jul 3, 2023
@cindy-peng
Copy link
Contributor

cindy-peng commented Jan 10, 2024

Hi @hitzam-wartek , could you please share the details how you create the logger, configure the logging options and how you log the information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants