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

Track span id when using Cloud Tracing nodejs client @opentelemetry/tracing #597

Closed
dan-sproutward opened this issue Jun 2, 2021 · 1 comment · Fixed by #599
Closed
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dan-sproutward
Copy link

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Is your feature request related to a problem? Please describe.
LoggingWinston will send trace id but not span id to Stackdriver Logging. Cloud Trace will pick this up if it is included in the log record.
Describe the solution you'd like
Add span id to logs sent to Stackdriver Logging per https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields.
Describe alternatives you've considered
None. Change needs to be made in LoggingWinston to support this. I created a shim locally that is a copy of common.js and index.js with the change.
Additional context

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging-winston API. label Jun 2, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 3, 2021
@0xSage 0xSage added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jun 4, 2021
gcf-merge-on-green bot pushed a commit that referenced this issue Jun 14, 2021
Fixes #597  🦕

Blocked: [Nodejs-logging release](googleapis/nodejs-logging#1092)

Changes: 
- Users can now hardcode a spanId via `LOGGING_SPAN_KEY` when using Winston
- Middleware scenario: if span is detected from the request obj, it is propagated to makeChildLogger, and emitRequestLog capabilities, and span is included in the final child logs.
- Fix e2e tests given `originalUrl` needs to be a real url
- export function `getCurrentTraceFromAgent`
@dan-sproutward
Copy link
Author

Works as expected. Thanks for picking this up.

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: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants