Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opentracing-contrib/java-apache-httpclient
OpenTracing Apache HttpClient instrumentation
https://github.com/opentracing-contrib/java-apache-httpclient
apache apache-httpcomponents httpclient instrumentation opentracing
Last synced: about 2 months ago
JSON representation
OpenTracing Apache HttpClient instrumentation
- Host: GitHub
- URL: https://github.com/opentracing-contrib/java-apache-httpclient
- Owner: opentracing-contrib
- License: apache-2.0
- Created: 2017-04-24T15:52:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T07:51:34.000Z (about 4 years ago)
- Last Synced: 2024-04-15T22:59:59.804Z (9 months ago)
- Topics: apache, apache-httpcomponents, httpclient, instrumentation, opentracing
- Language: Java
- Homepage:
- Size: 116 KB
- Stars: 11
- Watchers: 7
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status][ci-img]][ci] [![Released Version][maven-img]][maven]
# OpenTracing Apache HttpClient
Apache HttpClient instrumentation.
## Configuration
```java
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
```java
spanManager.activate(parentSpan); // called in the same thread as client.execute()
client.execute(new HttpGet("url"));
```### Manually
```java
BasicHttpContext basicHttpContext = new BasicHttpContext();
basicHttpContext.setAttribute(Constants.PARENT_CONTEXT, parentSpan.context());
client.execute(new HttpGet("url"), basicHttpContext);
```## Development
```shell
./mvnw clean install
```## Release
Follow instructions in [RELEASE](RELEASE.md)[ci-img]: https://travis-ci.org/opentracing-contrib/java-apache-httpclient.svg?branch=master
[ci]: https://travis-ci.org/opentracing-contrib/java-apache-httpclient
[maven-img]: https://img.shields.io/maven-central/v/io.opentracing.contrib/opentracing-apache-httpclient.svg?maxAge=2592000
[maven]: http://search.maven.org/#search%7Cga%7C1%7Copentracing-apache-httpclient