io.opentracing.contrib:opentracing-apache-httpclient

OpenTracing instrumentation for Apache HttpClient

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-apache-httpclient
Last Version

Last Version

0.3.3
Release Date

Release Date

Type

Type

jar
Description

Description

OpenTracing instrumentation for Apache HttpClient

Download opentracing-apache-httpclient

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-apache-httpclient/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-apache-httpclient</artifactId>
    <version>0.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-apache-httpclient/
implementation 'io.opentracing.contrib:opentracing-apache-httpclient:0.3.3'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-apache-httpclient/
implementation ("io.opentracing.contrib:opentracing-apache-httpclient:0.3.3")
'io.opentracing.contrib:opentracing-apache-httpclient:jar:0.3.3'
<dependency org="io.opentracing.contrib" name="opentracing-apache-httpclient" rev="0.3.3">
  <artifact name="opentracing-apache-httpclient" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-apache-httpclient', version='0.3.3')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-apache-httpclient" % "0.3.3"
[io.opentracing.contrib/opentracing-apache-httpclient "0.3.3"]

Dependencies

compile (3)

Group / Artifact Type Version
io.opentracing : opentracing-api jar 0.33.0
io.opentracing : opentracing-util jar 0.33.0
org.apache.httpcomponents : httpclient jar 4.5.3

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
io.opentracing : opentracing-mock jar 0.33.0
org.apache.httpcomponents : httpclient jar 4.5.3

Project Modules

There are no modules declared in this project.

Build Status Released Version

OpenTracing Apache HttpClient

Apache HttpClient instrumentation.

Configuration

GlobalTracer.register(tracer);
HttpClient httpClient = new TracingHttpClientBuilder()
    .build();

//custom configuration
HttpClient httpClient = new TracingHttpClientBuilder(
        redirectStrategy, 
        redirectHandlingDisabled,
        GlobalTracer.get(),
        spanDecorators)
    .build();

Linking to parent span

If parent span context is not passed created client spans will be in a new trace.

SpanManager

spanManager.activate(parentSpan); // called in the same thread as client.execute()
client.execute(new HttpGet("url"));

Manually

BasicHttpContext basicHttpContext = new BasicHttpContext();
basicHttpContext.setAttribute(Constants.PARENT_CONTEXT, parentSpan.context());
client.execute(new HttpGet("url"), basicHttpContext);

Development

./mvnw clean install

Release

Follow instructions in RELEASE

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
0.3.3
0.3.2
0.2.2
0.2.1
0.2.0
0.1.0
0.1.0-RC1
0.0.2
0.0.1