Skip to content

lucidsoftware/opentracing-jdbc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTracing for JDBC

Build Status Maven Version

Install

Published as the com.lucidchart:opentracing-jdbc artifact.

Example

import io.opentracing.contrib.jdbc.*;
import java.net.InetAddress;
import java.nio.ByteBuffer;

// optionally include peer info
JdbcPeer peer = new JdbcPeer();
peer.name = "my_db";
peer.ipv4 = ByteBuffer.wrap(InetAddress.getByName("127.0.0.1").getAddress()).getInt();
peer.port = 3306;

// create a SpanConnectionWrapper
SpanConnectionWrapper wrapper = SpanConnectionWrapper.createDefault(peer);

// wrap Connections
Connection rawConnection = ...
Connection tracedConnection = wrapper.wrap(rawConnection)