The plugin will add OpenTracing instrumentation to Sharding-JDBC. This plugin makes it easy for developers using the Sharding-JDBC to incorporate the tracer that support OpenTracing.
<dependency>
<groupId>io.shardingjdbc</groupId>
<artifactId>sharding-jdbc-opentracing</artifactId>
<version>${latest.version}</version>
</dependency>
There are two ways to incorporate io.opentracing.Tracer
object(eg. Zipkin, Skywalking) with this plugin.
- Get
io.opentracing.Tracer
object from Opentracing Tracer. - Invoke
io.shardingjdbc.opentracing.ShardingJDBCTracer#init(io.opentracing.Tracer)
before using Sharding-JDBC components.
You can set a tracer implement to the plugin by following instrument.
- Set
-Dshardingjdbc.opentracing.tracer.class=OPENTRACING_TRACER_CLASS_NAME
to start the application.OPENTRACING_TRACER_CLASS_NAME
MUST implement `io.opentracing.Tracer - Invoke
io.shardingjdbc.opentracing.ShardingJDBCTracer#init()
method before using Sharding-JDBC components.