You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
For longer running jobs I am creating new root spans that link back to the span that created them in order to better organise and trace what's going on.
In those newly created root spans (ultimately new traces) I am using LocalRootSpan.current().setAttribute(key, value). I expected this to set the attribute on the created root span, but instead the attribute will be on the original root span of the job that created the new span.
What did you expect to see?
I expect myattribute to be set on the created ProcessInNewRoot span.
What did you see instead?
Attribute is actually set on the original root span that invoked the processInNewRootSpan() method.
What version and what artifacts are you using?
Artifacts:
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:2.9.0,
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.43.0
Additional context
Am I wrong about my expected behaviour? The javadoc reads A local root span is a span that either does not have a parent span (it is the root span of a trace).
The newly created root span does not have a parent span.
The text was updated successfully, but these errors were encountered:
hi @patschl, LocalRootSpan is only an opentelemetry-instrumentation-api concept, and so only works if your local root span is created using opentelemetry-instrumentation-api and won't work if your local root span is created using opentelemetry-api
Describe the bug
For longer running jobs I am creating new root spans that link back to the span that created them in order to better organise and trace what's going on.
In those newly created root spans (ultimately new traces) I am using
LocalRootSpan.current().setAttribute(key, value)
. I expected this to set the attribute on the created root span, but instead the attribute will be on the original root span of the job that created the new span.Steps to reproduce
What did you expect to see?
I expect
myattribute
to be set on the createdProcessInNewRoot
span.What did you see instead?
Attribute is actually set on the original root span that invoked the
processInNewRootSpan()
method.What version and what artifacts are you using?
Artifacts:
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:2.9.0,
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.43.0
Environment
Compiler: AWS corretto 21.0.5
OS: (e.g., "Ubuntu 20.04")
Additional context
Am I wrong about my expected behaviour? The javadoc reads
A local root span is a span that either does not have a parent span (it is the root span of a trace)
.The newly created root span does not have a parent span.
The text was updated successfully, but these errors were encountered: