Unique Id is not getting generated via Open Telemetry. Getting repeated trace Id after 10 iterations #11951
-
@bean
} private Tracer tracer; private OpenTelemetry openTelemetry; AccountInfoController(OpenTelemetry openTelemetry) {
} Span span = tracer.spanBuilder(spanName).startSpan(); Context.current().with(parentSpan).makeCurrent(); However, I'm receiving the trace Id repeated after 10 iterations How to generate unique trace IDs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is a coding error on your part. The scope returned from |
Beta Was this translation helpful? Give feedback.
-
By closing the Context.current().with(parentSpan).makeCurrent(); fixed the issue |
Beta Was this translation helpful? Give feedback.
This is a coding error on your part. The scope returned from
Context.current().with(parentSpan).makeCurrent();
must be closed, it is best used with try with resource block.