Span processor cannot extract otel-context
key
#5723
-
Hello, I have a java agent extension with a span processor which tries to extract
I try to print out other context entries, and they all show up. Only I am using AWS OpenTelemetry Agent version 1.6.0 Many thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Also a little bit of context to what Im trying to do: I am injecting some entries into the context from the application, and in the span processor, I pick those entries up and add them to the span attributes. |
Beta Was this translation helpful? Give feedback.
-
Hey @thangcircle , |
Beta Was this translation helpful? Give feedback.
Hey @thangcircle ,
Are you using different
ContextKey
instances in your app and in theSpanProcessor
? Context keys are compared by reference (take a look at its javadoc for a small example), so if you're using different instances they are not the same context keys, even though they're named the same.To solve that, you can either make the
ContextKey
constant available both to the agent and the app (by putting it in the bootstrap classloader), or useBaggage
instead to propagate your custom entries.