-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrumentation broken with OpenTracing on classpath #575
Comments
The root cause is classpath related. The loader The Datadog instrumentation notices this setup and backs its instrumentation off because injecting instrumentation in that scenario won't have the desired effect. I realize this isn't a good "out of the box" experience. We're working on a long-term fix for these type of classloading scenarios. In the meantime either one of these workarounds can be used:
|
Thanks for the information! Since this is a traditional Spring app deployed to Tomcat as a WAR file it was easy to just add I'll leave this issue open to because the out-of-box experience could indeed use some improvement, but feel free to close it if this is already tracked somewhere else. |
It's fine to leave this open. We'll track this and close it out when the fix lands. Thanks for confirming the workaround! |
I think this is solved in |
We currently have a Spring app that has Datadog APM tracing set up using the Java agent. The app runs on Tomcat and uses JDBC and Apache HttpClient, both of which are instrumented by the agent. We also use the
dd-trace-api
dependency to manually mark methods for instrumentation using the@Trace
annotation:To get more granular trace spans, we want to use OpenTracing as recommended by the docs. We set up the required dependencies:
After this, tracing of both JDBC and Apache HttpClient calls stopped working, even without any
tracer.buildSpan
calls in the app.Looking at the debug output of the Java agent (
-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug
) confirms that something is off. This is the 'Applying instrumentation' output from an instance without the OpenTracing libraries on the classpath vs. with them:'Applying instrumentation' output without OpenTracing (OK)
'Applying instrumentation' output with OpenTracing (broken)
As can be seen from the logs, there is no instrumentation for
spring-web
,jdbc
andhttpclient
when OpenTracing is on the classpath.One thing that stands out is the following errors that appear in the logs when OpenTracing is added:
I'm not quite sure what the cause of this behaviour is. Maybe #433 is related?
The text was updated successfully, but these errors were encountered: