Skip to content

Store baggage so it's available to all future spans of same trace #9624

Answered by laurit
kbouck asked this question in Q&A
Discussion options

You must be logged in to vote

but it seems that this only works if the baggage was added in a scope that is current or an ancestor.

correct.

Walking back up the scope/context tree to set baggage at a higher level (context of Span A)?

this is not supported by the default context implementation. Context api acts like a stack, you can add elements on top of the stack and pop from the top, there is no api to iterate the stack or insert elements anywhere but the top.

Storing baggage somewhere so that it can be looked up and set for spans using a ContextCustomizer

ContextCustomizer is part of the instrumenter api used by the agent. It can be used to add stuff to context before the span is started with instrumenter api…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kbouck
Comment options

@laurit
Comment options

Answer selected by kbouck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants