Disable tracerresolver configuration
See original GitHub issueCurrently, if I want to use tracerresolver there is no way how to tell auto-config that I would like to use NoopTracer
to quickly “disable the instrumentation”. Probably we should provide a configuration property which would use Noop or resolve the tracer.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Configuration to disable tracerresolver · Issue #24 - GitHub
I have a use case when I am using tracerresolver and I would like to quickly disable instrumentation. Auto-config layer returns NoopTracer ...
Read more >TracerResolver.resolveTracer - Java - Tabnine
Attempts to load a Tracer directly from the ServiceLoader. isDisabled. There are two ways to globally disable the tracer resolver: * Setting a...
Read more >Chapter 19. Eclipse MicroProfile - Red Hat Customer Portal
JAX-RS endpoints are traced by default if the microprofile-opentracing-smallrye subsystem is present in the server configuration. To disable tracing for JAX-RS ...
Read more >Debugging in Coherence - Oracle Help Center
In such scenarios, disable the guardian and increase the packet timeout during the debugging ... See jaeger-tracerresolver for configuration details.
Read more >WildFly Admin Guide
The <color-output> block is used to configure the colors of the six ... able to provide their own tracers via the TracerResolver facility....
Read more >
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
To clarify this issue, the use case is to provide a way to quickly disable instrumentation.
I can think of two solutions:
1. disable all auto-configs with a property
This is by means is the best from the performance perspective. However, if users are using tracer inside the app it can fail in some scenarios (e.g. fails to autowire tracer bean).
2. use noop tracer
The only issue I currently have with noop tracer is that it does not use span source inside so switching from real tracer to noop can result in NPEs (e.g.
tracer.activeSpan()
retruns null (https://github.com/opentracing/opentracing-java/blob/master/opentracing-noop/src/main/java/io/opentracing/noop/NoopTracer.java#L41)). I would like to address this in the next version of the API.When somebody is not using tracerresolver and would like to disable instrumentation it can simply return NoopTracer bean or use:
So when he start app using
java -jar -Dinstrumentation.enabled=false foo.jar
our auto-config will use NoopTracer.However, if you are using tracerrresolver you cannot do ^^^. Tracer impl can be removed from classpath, however, it is not ideal for k8s deployment where you would like to control things via env properties.
I will close this for now.
At the moment all auto-configurations can be disabled with a property. Tracer configuration has been moved here https://github.com/opentracing-contrib/java-spring-tracer-configuration.