How to add Advice to SdkTracerProvider of JavaAgent? #15729
Unanswered
FWinkler79
asked this question in
Q&A
Replies: 0 comments
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.
-
I would like to modify the behavior of the
io.opentelemetry.sdk.trace.SdkTracerProviderclass that is instantiated by the auto-configuration within the JavaAgent. The reason is that I would like to introduce a secondSdkTracerthat runs with a different sampling strategy than the originalSdkTracerthat the originalSdkTracerProviderreturns.I have written an extension that tries to add an
Adviceto theio.opentelemetry.sdk.trace.SdkTracerProvider'sget(String instrumentation)method. But it seems the SdkTracerProvider is never called.I verified that my Advice code is correct by explicitly creating an instance of the
SdkTracerProviderin my app and calling itsget(...)method. But for some reason, my Advice is not called when theSdkTracerProvideris used by the JavaAgent.I read about the JavaAgent shading certain classes, i.e. changing their package names, etc. to not clash with the same classes introduced / referenced by the application.
How would I refer to the
SdkTracerProviderthat the JavaAgent uses under the hood and when it auto-configures the SDK that is then also made available viaGlobalOpenTelemetry.get()?Is it even possible to modify the OpenTelemetry SDK implementations?
Beta Was this translation helpful? Give feedback.
All reactions