question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable tracerresolver configuration

See original GitHub issue

Currently, 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.

cc @objectiser @jpkrohling

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pavolloffaycommented, Sep 7, 2017

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:

@ConditionalOnProperty(name = "instrumenation.enabled", havingValue = "true", matchIfMissing = true)
@Bean
Tracer tracer() {...}

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.

0reactions
pavolloffaycommented, Jun 13, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found