OpenTracing Instrumentation for org.asynchttpclient
Requirements
- AsyncHttpClient >= 2.0.0
- OpenTracing Java = 0.32.0
Installation
Releases are hosted on Maven Central.
pom.xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-asynchttpclient</artifactId>
<version>VERSION</version>
</dependency>
Usage
// Instantiate tracer
Tracer tracer = ...
// Build TracingAsyncHttpClient
AsyncHttpClient client = new TracingAsyncHttpClient(tracer);
// By default spans are always created
// To trace only if there is an active span
// Build TracingAsyncHttpClient with optional parameter set to true
AsyncHttpClient client = new TracingAsyncHttpClient(tracer, true);