-
I built a very simple Springboot REST API to test the metric collection and tracing. The metric collection is working fine, but I have issues with the tracing. I am using the opentelemetry javaagent when starting the application.
When I call a endpoint exposed from the service, I get below printed in the console.
As you can see, It prints zeros as the trace id and the span id. I know this question is similar to one below. But I have made sure that spring uses opentelemetry sdk version 1.22.0 and i am using the java agent jar for the same version.(1.22.0) How can I solve this issue. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
hi @vigamage, are you following https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md? what happens if you print |
Beta Was this translation helpful? Give feedback.
-
@trask I get the same issue. When I print the In fact, I build the
The {
//... Other request data
"otel-ctx": {
traceparent: "00-f4cd9f124f94a8e029c0d5d72078759f-4a4eae6a3402fb14-01"
}
} |
Beta Was this translation helpful? Give feedback.
hi @vigamage, are you following https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/logger-mdc-instrumentation.md?
what happens if you print
Span.current().getSpanContext().getTraceId()
from inside of your code at that point where you are performing the logging?