opentelemetry-js
opentelemetry-js copied to clipboard
Experimental Logs Package -- Adding Trace ID and Transaction ID for log correlation in Elastic
- [x] 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!
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.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stale for 14 days with no activity.