opentracing-contrib / java-jdbc

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

feat: enhance API to inject specific tracer instance into #16

Closed dleischnig closed 6 years ago

dleischnig commented 6 years ago

Currently java-jdbc only supports tracer instance distribution through static GlobalTracer mechanism.

To support distribution by injection API has been enhanced. In case no tracer is injected backward compatibility is kept by fallback to GlobalTracer.get().

This allows to write unittests, for java-jdbc and components that use this lib, without usage of reflection to reset GlobalTracer registration.

Furthermore it allows to use this integration lib within software where GlobalTracer.get() can't be used. (limitation: the component has to have access to connection creation code)

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 64


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/io/opentracing/contrib/jdbc/JdbcTracingUtils.java 17 19 89.47%
src/main/java/io/opentracing/contrib/jdbc/TracingCallableStatement.java 0 3 0.0%
src/main/java/io/opentracing/contrib/jdbc/TracingPreparedStatement.java 3 6 50.0%
src/main/java/io/opentracing/contrib/jdbc/TracingStatement.java 7 17 41.18%
<!-- Total: 32 50 64.0% -->
Totals Coverage Status
Change from base Build 63: 1.07%
Covered Lines: 132
Relevant Lines: 543

💛 - Coveralls