Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renames #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.Set;
import java.util.function.Function;

public abstract class HttpClientConfigBuilder<SELF, REQUEST, RESPONSE> {
public abstract class AbstractHttpClientTelemetryBuilder<SELF, REQUEST, RESPONSE> {

private final String instrumentationName;
protected final OpenTelemetry openTelemetry;
Expand All @@ -42,7 +42,7 @@ public abstract class HttpClientConfigBuilder<SELF, REQUEST, RESPONSE> {
spanNameExtractorTransformer = Function.identity();
private boolean emitExperimentalHttpClientMetrics = false;

protected HttpClientConfigBuilder(
public AbstractHttpClientTelemetryBuilder(
String instrumentationName,
OpenTelemetry openTelemetry,
HttpClientAttributesGetter<REQUEST, RESPONSE> attributesGetter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import io.opentelemetry.javaagent.instrumentation.akkahttp.AkkaHttpUtil;

public class AkkaHttpClientSingletons {
Expand All @@ -21,7 +21,7 @@ public class AkkaHttpClientSingletons {
static {
SETTER = new HttpHeaderSetter(GlobalOpenTelemetry.getPropagators());
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
AkkaHttpUtil.instrumentationName(), new AkkaHttpClientAttributesGetter())
.buildInstrumenter(SpanKindExtractor.alwaysClient());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.apachehttpasyncclient;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.apache.http.HttpResponse;

public final class ApacheHttpAsyncClientSingletons {
Expand All @@ -16,7 +16,7 @@ public final class ApacheHttpAsyncClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new ApacheHttpAsyncClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.apachehttpclient.v2_0;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.apache.commons.httpclient.HttpMethod;

public final class ApacheHttpClientSingletons {
Expand All @@ -16,7 +16,7 @@ public final class ApacheHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new ApacheHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.apachehttpclient.v4_0;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.apache.http.HttpResponse;

public final class ApacheHttpClientSingletons {
Expand All @@ -16,7 +16,7 @@ public final class ApacheHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new ApacheHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
package io.opentelemetry.instrumentation.apachehttpclient.v4_3;

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.incubator.builder.HttpClientConfigBuilder;
import io.opentelemetry.instrumentation.api.incubator.builder.AbstractHttpClientTelemetryBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import org.apache.http.HttpResponse;

/** A builder for {@link ApacheHttpClientTelemetry}. */
public final class ApacheHttpClientTelemetryBuilder
extends HttpClientConfigBuilder<
extends AbstractHttpClientTelemetryBuilder<
ApacheHttpClientTelemetryBuilder, ApacheHttpClientRequest, HttpResponse> {

private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-4.3";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.apachehttpclient.v5_0;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.apache.hc.core5.http.HttpRequest;
import org.apache.hc.core5.http.HttpResponse;

Expand All @@ -17,7 +17,7 @@ public final class ApacheHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new ApacheHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.ning.http.client.Request;
import com.ning.http.client.Response;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;

public final class AsyncHttpClientSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.async-http-client-1.9";
Expand All @@ -17,7 +17,7 @@ public final class AsyncHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new AsyncHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.asynchttpclient.v2_0;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.asynchttpclient.Response;

public final class AsyncHttpClientSingletons {
Expand All @@ -16,7 +16,7 @@ public final class AsyncHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new AsyncHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;

public class GoogleHttpClientSingletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.google-http-client-1.19";
Expand All @@ -17,7 +17,7 @@ public class GoogleHttpClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new GoogleHttpClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.CommonConfig;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import java.net.HttpURLConnection;

public final class HttpUrlConnectionSingletons {
Expand All @@ -16,7 +16,7 @@ public final class HttpUrlConnectionSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
"io.opentelemetry.http-url-connection", new HttpUrlHttpAttributesGetter())
.addAttributesExtractor(
HttpMethodAttributeExtractor.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import io.opentelemetry.instrumentation.httpclient.JavaHttpClientTelemetryBuilder;
import io.opentelemetry.instrumentation.httpclient.internal.HttpHeadersSetter;
import io.opentelemetry.instrumentation.httpclient.internal.JavaHttpClientAttributesGetter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

Expand All @@ -24,7 +23,7 @@ public class JavaHttpClientSingletons {
SETTER = new HttpHeadersSetter(GlobalOpenTelemetry.getPropagators());

INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
ConfiguredHttpClientInstrumenterBuilder.create(
JavaHttpClientTelemetryBuilder.INSTRUMENTATION_NAME,
JavaHttpClientAttributesGetter.INSTANCE)
.buildInstrumenter(SpanKindExtractor.alwaysClient());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.instrumentation.httpclient;

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.incubator.builder.HttpClientConfigBuilder;
import io.opentelemetry.instrumentation.api.incubator.builder.AbstractHttpClientTelemetryBuilder;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import io.opentelemetry.instrumentation.httpclient.internal.HttpHeadersSetter;
Expand All @@ -15,7 +15,8 @@
import java.net.http.HttpResponse;

public final class JavaHttpClientTelemetryBuilder
extends HttpClientConfigBuilder<JavaHttpClientTelemetryBuilder, HttpRequest, HttpResponse<?>> {
extends AbstractHttpClientTelemetryBuilder<
JavaHttpClientTelemetryBuilder, HttpRequest, HttpResponse<?>> {

public static final String INSTRUMENTATION_NAME = "io.opentelemetry.java-http-client";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import io.opentelemetry.instrumentation.jetty.httpclient.v9_2.JettyClientTelemetry;
import io.opentelemetry.instrumentation.jetty.httpclient.v9_2.internal.HttpHeaderSetter;
import io.opentelemetry.instrumentation.jetty.httpclient.v9_2.internal.JettyClientHttpAttributesGetter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.api.Response;

public class JettyHttpClientSingletons {

private static final Instrumenter<Request, Response> INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
JettyClientTelemetry.INSTRUMENTATION_NAME, JettyClientHttpAttributesGetter.INSTANCE)
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.incubator.builder.HttpClientConfigBuilder;
import io.opentelemetry.instrumentation.api.incubator.builder.AbstractHttpClientTelemetryBuilder;
import io.opentelemetry.instrumentation.jetty.httpclient.v9_2.internal.HttpHeaderSetter;
import io.opentelemetry.instrumentation.jetty.httpclient.v9_2.internal.JettyClientHttpAttributesGetter;
import org.eclipse.jetty.client.HttpClientTransport;
Expand All @@ -17,7 +17,7 @@

/** A builder of {@link JettyClientTelemetry}. */
public final class JettyClientTelemetryBuilder
extends HttpClientConfigBuilder<JettyClientTelemetryBuilder, Request, Response> {
extends AbstractHttpClientTelemetryBuilder<JettyClientTelemetryBuilder, Request, Response> {

private HttpClientTransport httpClientTransport;
private SslContextFactory sslContextFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.joddhttp.v4_2;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;

Expand All @@ -17,7 +17,7 @@ public final class JoddHttpSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new JoddHttpHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import io.opentelemetry.instrumentation.netty.common.internal.NettyConnectionRequest;
import io.opentelemetry.instrumentation.netty.common.internal.NettyErrorHolder;
import io.opentelemetry.javaagent.bootstrap.internal.CommonConfig;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import io.opentelemetry.javaagent.instrumentation.netty.v3_8.HttpRequestAndChannel;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.HttpResponse;
Expand All @@ -27,7 +27,7 @@ public final class NettyClientSingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new NettyHttpClientAttributesGetter())
.addContextCustomizer(
(context, requestAndChannel, startAttributes) -> NettyErrorHolder.init(context))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.squareup.okhttp.Response;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;

public final class OkHttp2Singletons {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.okhttp-2.2";
Expand All @@ -22,7 +22,7 @@ public final class OkHttp2Singletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new OkHttp2HttpAttributesGetter())
.buildInstrumenter(alwaysClient());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.PekkoHttpUtil;
import org.apache.pekko.http.scaladsl.model.HttpRequest;
import org.apache.pekko.http.scaladsl.model.HttpResponse;
Expand All @@ -22,7 +22,7 @@ public class PekkoHttpClientSingletons {
SETTER = new HttpHeaderSetter(GlobalOpenTelemetry.getPropagators());

INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
PekkoHttpUtil.instrumentationName(), new PekkoHttpClientAttributesGetter())
.buildInstrumenter(SpanKindExtractor.alwaysClient());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
package io.opentelemetry.javaagent.instrumentation.playws;

import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import play.shaded.ahc.org.asynchttpclient.Request;
import play.shaded.ahc.org.asynchttpclient.Response;

public final class PlayWsClientInstrumenterFactory {

public static Instrumenter<Request, Response> createInstrumenter(String instrumentationName) {
return HttpClientInstrumenterFactory.builder(
return JavaagentHttpClientInstrumenterBuilder.create(
instrumentationName, new PlayWsClientHttpAttributesGetter())
.buildClientInstrumenter(HttpHeaderSetter.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import io.opentelemetry.instrumentation.netty.v4.common.internal.client.NettyConnectionInstrumentationFlag;
import io.opentelemetry.instrumentation.netty.v4.common.internal.client.NettyConnectionInstrumenter;
import io.opentelemetry.javaagent.bootstrap.internal.CommonConfig;
import io.opentelemetry.javaagent.bootstrap.internal.HttpClientInstrumenterFactory;
import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpClientInstrumenterBuilder;
import io.opentelemetry.javaagent.bootstrap.internal.InstrumentationConfig;
import reactor.netty.http.client.HttpClientRequest;
import reactor.netty.http.client.HttpClientResponse;
Expand All @@ -29,7 +29,7 @@ public final class ReactorNettySingletons {

static {
INSTRUMENTER =
HttpClientInstrumenterFactory.builder(
JavaagentHttpClientInstrumenterBuilder.create(
INSTRUMENTATION_NAME, new ReactorNettyHttpClientAttributesGetter())
.buildClientInstrumenter(HttpClientRequestHeadersSetter.INSTANCE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
package io.opentelemetry.instrumentation.spring.web.v3_1;

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.incubator.builder.HttpClientConfigBuilder;
import io.opentelemetry.instrumentation.api.incubator.builder.AbstractHttpClientTelemetryBuilder;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpResponse;

/** A builder of {@link SpringWebTelemetry}. */
public final class SpringWebTelemetryBuilder
extends HttpClientConfigBuilder<SpringWebTelemetryBuilder, HttpRequest, ClientHttpResponse> {
extends AbstractHttpClientTelemetryBuilder<
SpringWebTelemetryBuilder, HttpRequest, ClientHttpResponse> {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-web-3.1";

SpringWebTelemetryBuilder(OpenTelemetry openTelemetry) {
Expand Down
Loading
Loading