How to access Context values in the application that were set in the agent via a custom TextMapPropagator? #1847
Closed
brenlong83
announced in
Community Discussions
Replies: 1 comment
-
|
hi @brenlong83! I'd recommend asking this question in https://github.com/open-telemetry/opentelemetry-java-instrumentation |
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
Uh oh!
There was an error while loading. Please reload this page.
-
We have implemented a custom
TextMapPropagatoras a Java agent extension to propagate an access token across several micro services. That all works as expected.Now the interesting part, in some of the micro services we need to introspect the token.
The problem we are facing is the
ContextKeydoesn't match between the app definition and the agent definition asContextKeyis compared for equality by reference. Since the class is effectively duplicated in two class loaders (app/agent) the references don't match so from the application perspective the key is never set. It's frustrating because if we log theContextobject we see the token right there, only it's not accessible.What would be the recommended method to get app access to something that was originally set in the
Contextfrom the agent?Beta Was this translation helpful? Give feedback.
All reactions