Closed philsch closed 2 years ago
@philsch thank you for letting us know and the detailed report. the described issue duplicates the problem with the resource type auto capturing in googleapis/nodejs-logging#1127.
@minherz Is this safe to close? I believe this was addressed in https://github.com/googleapis/nodejs-logging/pull/1145
Verified. Thank you, @daniel-sanche
Environment details
@google-cloud/logging-bunyan
version: 3.1.0Expected behavior
As stated in
/@google-cloud/logging-bunyan/build/src/types/core.d.ts
The Gcloud resource should be detected automatically. This is however not the case for Google Cloud Run.
Steps to reproduce
const bunyanLogger = new LoggingBunyan(); const logger = bunyan.createLogger({ name: PACKAGE_NAME, streams: [ // Log to the console at 'info' and above { stream: process.stdout, level: 'info' }, // And log to Stackdriver Logging, logging at 'info' and above bunyanLogger.stream('info'), ], });
export default logger;
resource.type = "cloud_run_revision" resource.labels.service_name = "service-proxy-logger" resource.labels.location = "europe-west3" severity>=DEFAULT
logName: "projects/usercentrics-playground/logs/bunyan_log"
const bunyanLogger = new LoggingBunyan({ resource: { type: "cloud_run_revision", labels: { location: "europe-west3", service_name: PACKAGE_NAME } } });