Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 852 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 852 Bytes

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)