OpenTracing AutoConfiguration crashes with a non-brave OT implementation
See original GitHub issueOpenTracingAutoConfiguration creates a Brave Tracer if OpenTracing classes are on the classpath.
This crashes the app if a non-brave OT implementation is used. To Repro:
- Launch SpringBoot2 with a Datadog JavaAgent with no Brave classes present: https://docs.datadoghq.com/tracing/setup/java/#installation-and-getting-started
- App will crash on startup:
java.lang.ClassNotFoundException: brave.opentracing.BraveTracer
As a workaround, the OT configuration can be disabled.
Seems like a simple fix would be to add a check for a brave implementation to the OT autoconfiguration.
@ConditionalOnClass(Tracer.class, BraveTracer.clss)
Happy to open a PR if that helps.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@adriancole Thanks for the explanation. That makes sense. Usually better to crash early than behave strangely later.
In terms of putting OT on the classpath, that’s an early design decision of the dd tracer. We’re working to decouple the dd tracer from OT so we don’t have to inject OT classes for javaagent users.
This won’t actually work the way you are expecting it to. If you disable the
BraveTracer
and create an instance of someOtherTracer
then you will end up with 2 different tracing systems; sleuth (built on brave) and your OT tracer. The OT support in Sleuth is explicitly to allow the use of OT instrumentation not to swap the tracer since sleuth is a tracer itself historically.