opentracing-contrib / java-jdbc

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

Auto detect ConnectInfo from underlying DataSource #94

Closed quaff closed 4 years ago

quaff commented 4 years ago

Most popular DataSource provide method to get jdbc url, we should use it.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 299


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/io/opentracing/contrib/jdbc/TracingDataSource.java 9 15 60.0%
<!-- Total: 9 15 60.0% -->
Totals Coverage Status
Change from base Build 298: 0.07%
Covered Lines: 524
Relevant Lines: 1087

💛 - Coveralls
quaff commented 4 years ago

@malafeev How about this.tracer = tracer != null ? tracer : GlobalTracer.get() and add a minimal constructor TracingDataSource(DataSource underlying)? I will create a new PR if this merged.