Enabling Auto-Instrumentation via AutoConfiguredOpenTelemetrySdk rather than Java Agent #5224
Unanswered
paychex-ssmithrand
asked this question in
Q&A
Replies: 2 comments 2 replies
-
No, there is no way to wire-up instrumentation via our autoconfigure module. That is only for configuring the SDK itself. It's an interesting idea, but I'm not sure exactly how it would work. We'd need to create a new SPI that instrumentation could implement. But, I don't know how that instrumentation would get attached to anything automatically. |
Beta Was this translation helpful? Give feedback.
2 replies
-
@paychex-ssmithrand you might find this interesting? https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/runtime-attach |
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
-
I don't want to attach the Java agent jar to services, so I went down the route of setting up the SDK programmatically in a configuration file. Is there a way to add instrumentation libraries to the SDK in this fashion? Does
AutoConfiguredOpenTelemetrySdk
use the same environment variables as the agent to determine which libraries to instrument?ie.
OTEL_INSTRUMENTATION_SPRING_MVC_ENABLED=true
should enable Spring MVC auto instrumentation for the agent.I know there is a Spring starter module that will set up the interceptor, etc for requests/responses, but that starter does not include Spring Data, or non-http libraries to be instrumented.
EDIT: Doing some more digging around the SDK and related files, would this be done via a
TracerProvider
and passing in an auto-instrumentation class name?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions