In python, there is an option to inject trace details(tracid,spanid) to application logs using environment variable (export OTEL_PYTHON_LOG_CORRELATION=true). Is there something similar in Nodejs or Go. I couldn't find any autoinstrumentaion for tracing in Go (We can manually instrument, by creating spans and wrappers for handlers). So I don't expect answer from Go language, but probably, Node might have a solution
Asked
Active
Viewed 731 times
0
-
In Go, You can do this using context. Refer [here](https://golang.org/pkg/context/) and look in to tracing tool [zipkin](https://zipkin.io/pages/tracers_instrumentation#:~:text=Tracing%20information%20is%20collected%20on,the%20data%20together%20into%20spans.) – nipuna May 14 '21 at 12:22
-
that is possible with context,, so that we need to add span,, and wrappers around handler function.. that is why I said, manually it is possible,, but in python,, you don't need such king of wrappers. you only need to import opentelemetry library, and configure backend like jaeger – jaison May 14 '21 at 13:35
-
I received a solution in Nodejs from the opentelemetry official support community . plz find the answer here -->https://github.com/open-telemetry/opentelemetry-js-api/discussions/67. Solution is to use log framework like bunyan, pino, winston – jaison May 15 '21 at 02:22