io.opentelemetry.instrumentation.apachehttpclient.v4_3.TracingHttpClientBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-apache-httpclient-4.3 Show documentation
Show all versions of opentelemetry-apache-httpclient-4.3 Show documentation
Instrumentation of Java libraries using OpenTelemetry.
The newest version!
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.instrumentation.apachehttpclient.v4_3;
import io.opentelemetry.context.propagation.ContextPropagators;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import org.apache.http.HttpResponse;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.execchain.ClientExecChain;
final class TracingHttpClientBuilder extends HttpClientBuilder {
private final Instrumenter instrumenter;
private final ContextPropagators propagators;
TracingHttpClientBuilder(
Instrumenter instrumenter,
ContextPropagators propagators) {
this.instrumenter = instrumenter;
this.propagators = propagators;
}
@Override
protected ClientExecChain decorateProtocolExec(ClientExecChain protocolExec) {
return new TracingProtocolExec(instrumenter, propagators, protocolExec);
}
}