opentracing-contrib / java-jdbc

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

Make interceptor mode of TracingDriver work with other wrapper drivers #69

Closed yisheng-liang closed 4 years ago

yisheng-liang commented 4 years ago

Problem

In the interceptor mode ofTracingDriver, it is supposed to be able to trace JDBC connections without modifying the URL. However, this may not work in some cases. For instance, if another wrapper driver calls Driver#acceptsURL for each registered driver in order to find the underlying driver, it won't see TracingDriver unless the JDBC URL has been rewritten to have the jdbc:tracing: prefix.

Solution

In interceptor mode, TracingDriver#acceptsURL should accept any JDBC URL. The user should not need to (and should not) modify the URL for the interceptor mode to work. Also, in interceptor mode, TracingDriver should not try to extract withActiveSpanOnly or ignoreStatements properties from the URL, as they should be set via TracingDriver#setInterceptorProperty.

Fixes opentracing-contrib/java-jdbc#68.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 240


Totals Coverage Status
Change from base Build 238: 0.1%
Covered Lines: 451
Relevant Lines: 969

💛 - Coveralls