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

Experimental Logs Package -- Adding Trace ID and Transaction ID for log correlation in Elastic #4618

Open
1 task done
christymcgrory opened this issue Apr 9, 2024 · 1 comment

Comments

@christymcgrory
Copy link

  • This may affect other libraries, but I would like to get opinions here first

Setup

Node JS Lambda using the OpenTelemetry Lambda SDK and Collector Layers, with the exporter set up to export to an Elastic Cloud Instance.

Issue

I'm currently able to export Logs through the OTLP Receiver and to my Elastic Stack Endpoint -- I can see the logs are attributed to the correct service name. However, I have currently been unable to find a way to inject the Trace ID/Transaction ID into the log output so that I can receive correlated logs in my Traces view. I was trying to use the @opentelemetry/api package in order to get either of the ID's, but unfortunately they were undefined.

I realise the log exporter is currently experimental, but has anyone found a way to achieve this?

Thanks in Advance!

@jundai-godaddy
Copy link

jundai-godaddy commented Apr 9, 2024

What are you using to log? If I use winston and have @opentelemetry/winston-transport installed and am instrumenting with @opentelemetry/instrumentation-winston (this turns itself on by default if you use @opentelemetry/auto-instrumentations-node), then I see the trace id correlated with the traces in the APM view in kibana.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants