opentracing-contrib / java-jdbc

OpenTracing Instrumentation for JDBC
Apache License 2.0
82 stars 56 forks source link

Control whether jdbc traces will be enabled or not. #56

Closed osvaldopina closed 4 years ago

osvaldopina commented 4 years ago

I'm new to this library and I could not find a way to turn it on and off depending on a global configuration. My need is to control wheter I'm going to trace jdbc calls or not and chage this behavior without the need to restart de application. Is it possible?

malafeev commented 4 years ago

In general it's not supported. For interceptor usage TracingDriver.setInterceptorProperty(true); and TracingDriver.setInterceptorProperty(false); can work in some cases. But not always, it's limited to new connections and will not work for connection pool.