opentracing-contrib / java-jdbc

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

Ignore certain statements #13

Closed will-gtv closed 6 years ago

will-gtv commented 6 years ago

Spring uses "SELECT 1" to health check the connection to database which gets traced by default. Rather forcing systems with a DB health check to set "traceWithActiveSpanOnly" to false this patch allows certain queries to be entirely ignored by the tracer.

We've just started deploying the JDBC tracer to our infrastructure, and it's really great to see the queries from each rest call as part of the trace but our Zipkin UI is drowning in thousands of "SELECT 1" traces. We'd rather not be forced to set "traceWithActiveSpanOnly" because we'd like to understand where and how there is database access without an existing trace scope.