Helper class not sharing because of 2 class loaders #13516
Unanswered
srinivas-bitla
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Currently no, advice code runs inside your application, it does not see the agent classes. You could solve this by placing an api in the boot loader that is visible to both the application and the agent. Note that we have some plans for reworking how advice works so sharing data between agent and advice code may become easier in future versions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am creating a custom extension for otel java instrumentation agent following the instructions here https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/extension. I have
What I find is that, CustomLogRecorder is loaded twice by 2 different class loaders. CustomSampler is loading it using otel class loader and InstrumentationModule is loading it again using a different class loader. Because of this I am unable to share the static data between CustomSampler and CustomAdvice. Is it possible to load CustomLogRecorder by only otel class loader in both cases?
Beta Was this translation helpful? Give feedback.
All reactions