Closed yisheng-liang closed 4 years ago
that's not so simple.
acceptsURL(...)
is used in TracingDriver.connect(...)
:
https://github.com/opentracing-contrib/java-jdbc/blob/master/src/main/java/io/opentracing/contrib/jdbc/TracingDriver.java#L153
this if
statement also should be modified to explicitly accept urls only with "jdbc:tracing:"
We could modify TracingDriver#connect
such that it doesn't try to parse the url if interceptorMode
is true. Just need to move around those if
branches like this:
if (interceptorMode) {
withActiveSpanOnly = TracingDriver.withActiveSpanOnly;
ignoreStatements = TracingDriver.ignoreStatements;
} else if (acceptsURL(url)) {
withActiveSpanOnly = url.contains(WITH_ACTIVE_SPAN_ONLY);
ignoreStatements = extractIgnoredStatements(url);
url = extractRealUrl(url);
} else {
return null;
}
I think this makes sense. Since in interceptor mode, the driver is supposed to be able to intercept JDBC operations without the need of modifying JDBC URLs, so it should not even try to find traceWithActiveSpanOnly
or ignoreForTracing
from the URLs.
@yisheng-liang would you like to submit PR?
Are you going to cut a new release soon? Releases were cut in January quite often but nothing in February.
0.2.9 is released
Interceptor mode may not work in some cases. For instance, if another wrapper driver calls
Driver#acceptsURL
for each registered driver in order to find an underlying driver, it won't seeTracingDriver
unless the JDBC URL has been rewritten to have thejdbc:tracing:
prefix.Simple fix is to change
TracingDriver#acceptsURL
to be: