Propagate baggage attributes as span attributes to root span #9563
Unanswered
MadhusudanN
asked this question in
Q&A
Replies: 1 comment
-
If the root span is created in the same service then you can get it with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
As explained in the below discussion forums ::
open-telemetry/opentelemetry-java#5834
open-telemetry/opentelemetry-java#4801
We need to create baggage with attributes in the current context and propagate it to the downstream code enclosed within the current context. Use the custom span processor to extract from baggage and add as span attributes. This has worked fine.
Requirement ::
Is there a way to set span attributes of root span with baggage attributes
Scenario ::
A java based micro-service which has logging filter, baggage is set at this filter with some attributes and is propagated to further spans.
The custom attributes are seen only at the controller layer and further but not at the root span. Please find the image below which depicts this.
Water fall diagram of trace ::

Custom attribute is the user_id which is seen at controller layer ::
Custom attribute user_id not seen at the root span ::
The root span is highlighted below
The root span attributes are shown below ::

In the above we do not see the user_id attribute.
Can someone please let me know if there is a way to propagate the baggage as span attribute at this root span level.
Beta Was this translation helpful? Give feedback.
All reactions