-
Notifications
You must be signed in to change notification settings - Fork 59
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
Disable tracerresolver configuration #38
Comments
As TracerResolver relies on the relevant tracer being in the classpath, wouldn't another option just be to comment out the tracer dependency? Not saying a config option wouldn't be ok, but just looking at alternatives. |
Yeah, that is one possibility although it might be inconvenient. I would like to port https://github.com/redhat-helloworld-msa/ola and other SB services to use tracerresolver. Currently the code use noop is tracer server URL is not specified. |
I think your case is one that warrants setting the "skip tracer resolver" flag and dealing with the |
I would like to get rid of all app level logic regarding tracing. And I would like to be able to enable/disable tracing with some ENV property. (currently it can be done by using noop, we could also use one conf. property on all auto-configs) |
If this was going to be done via env/property - then it would be better done in the TracerResolver itself, so it would be applicable outside any particular instrumentation/framework. |
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 propertyThis 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 tracerThe 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. 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 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'd like to be able to completely skip the autoconfig (like we can do in https://github.com/opentracing-contrib/java-spring-cloud/) It would be the responsibility of the user to inject the tracer with required=false Currently, what would be the alternative to skip web tracing? (for IT tests for example or for some environments where you are not interested in tracing metrics?) |
@ask4gilles I have created a separate issue for this: #65. Let me know if you would like to contribute it, it seems like a simple fix. |
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. |
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
The text was updated successfully, but these errors were encountered: