diff --git a/instrumentation/apache-dubbo-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java b/instrumentation/apache-dubbo-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java index b14b6e574d83..915289cd8094 100644 --- a/instrumentation/apache-dubbo-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java +++ b/instrumentation/apache-dubbo-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java @@ -6,7 +6,7 @@ package io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.apachedubbo.v2_7.DubboTracing; +import io.opentelemetry.instrumentation.apachedubbo.v2_7.DubboTelemetry; import org.apache.dubbo.common.extension.Activate; import org.apache.dubbo.rpc.Filter; import org.apache.dubbo.rpc.Invocation; @@ -19,7 +19,7 @@ public class OpenTelemetryFilter implements Filter { private final Filter delegate; public OpenTelemetryFilter() { - delegate = DubboTracing.create(GlobalOpenTelemetry.get()).newFilter(); + delegate = DubboTelemetry.create(GlobalOpenTelemetry.get()).newFilter(); } @Override diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracing.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetry.java similarity index 64% rename from instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracing.java rename to instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetry.java index 25b8b8c331a7..982ab442d27f 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracing.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetry.java @@ -10,23 +10,25 @@ import org.apache.dubbo.rpc.Filter; import org.apache.dubbo.rpc.Result; -/** Entrypoint for tracing Apache Dubbo servers and clients. */ -public final class DubboTracing { +/** Entrypoint for instrumenting Apache Dubbo servers and clients. */ +public final class DubboTelemetry { - /** Returns a new {@link DubboTracing} configured with the given {@link OpenTelemetry}. */ - public static DubboTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link DubboTelemetry} configured with the given {@link OpenTelemetry}. */ + public static DubboTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link DubboTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static DubboTracingBuilder builder(OpenTelemetry openTelemetry) { - return new DubboTracingBuilder(openTelemetry); + /** + * Returns a new {@link DubboTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static DubboTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new DubboTelemetryBuilder(openTelemetry); } private final Instrumenter serverInstrumenter; private final Instrumenter clientInstrumenter; - DubboTracing( + DubboTelemetry( Instrumenter serverInstrumenter, Instrumenter clientInstrumenter) { this.serverInstrumenter = serverInstrumenter; diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracingBuilder.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java similarity index 91% rename from instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracingBuilder.java rename to instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java index b8b6e68ba464..bbe1f6e4ab3c 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTracingBuilder.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboTelemetryBuilder.java @@ -24,8 +24,8 @@ import javax.annotation.Nullable; import org.apache.dubbo.rpc.Result; -/** A builder of {@link DubboTracing}. */ -public final class DubboTracingBuilder { +/** A builder of {@link DubboTelemetry}. */ +public final class DubboTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-dubbo-2.7"; @@ -34,7 +34,7 @@ public final class DubboTracingBuilder { private final List> attributesExtractors = new ArrayList<>(); - DubboTracingBuilder(OpenTelemetry openTelemetry) { + DubboTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -47,14 +47,16 @@ public void setPeerService(String peerService) { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public DubboTracingBuilder addAttributesExtractor( + public DubboTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { attributesExtractors.add(attributesExtractor); return this; } - /** Returns a new {@link DubboTracing} with the settings of this {@link DubboTracingBuilder}. */ - public DubboTracing build() { + /** + * Returns a new {@link DubboTelemetry} with the settings of this {@link DubboTelemetryBuilder}. + */ + public DubboTelemetry build() { DubboRpcAttributesGetter rpcAttributesGetter = DubboRpcAttributesGetter.INSTANCE; SpanNameExtractor spanNameExtractor = RpcSpanNameExtractor.create(rpcAttributesGetter); @@ -83,7 +85,7 @@ public DubboTracing build() { PeerServiceAttributesExtractor.create(netClientAttributesGetter)); } - return new DubboTracing( + return new DubboTelemetry( serverInstrumenterBuilder.newServerInstrumenter(DubboHeadersGetter.INSTANCE), clientInstrumenterBuilder.newClientInstrumenter(DubboHeadersSetter.INSTANCE)); } diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java index c59e9b196d89..8cf99f56d89a 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/OpenTelemetryFilter.java @@ -18,7 +18,7 @@ public final class OpenTelemetryFilter implements Filter { private final Filter delegate; public OpenTelemetryFilter() { - delegate = DubboTracing.create(GlobalOpenTelemetry.get()).newFilter(); + delegate = DubboTelemetry.create(GlobalOpenTelemetry.get()).newFilter(); } @Override diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracing.java b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetry.java similarity index 69% rename from instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracing.java rename to instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetry.java index 8d555337f89a..60ac19919ed2 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracing.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetry.java @@ -12,28 +12,29 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -/** Entrypoint for tracing Apache HTTP Client. */ -public final class ApacheHttpClientTracing { +/** Entrypoint for instrumenting Apache HTTP Client. */ +public final class ApacheHttpClientTelemetry { /** - * Returns a new {@link ApacheHttpClientTracing} configured with the given {@link OpenTelemetry}. + * Returns a new {@link ApacheHttpClientTelemetry} configured with the given {@link + * OpenTelemetry}. */ - public static ApacheHttpClientTracing create(OpenTelemetry openTelemetry) { + public static ApacheHttpClientTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link ApacheHttpClientTracingBuilder} configured with the given {@link + * Returns a new {@link ApacheHttpClientTelemetryBuilder} configured with the given {@link * OpenTelemetry}. */ - public static ApacheHttpClientTracingBuilder builder(OpenTelemetry openTelemetry) { - return new ApacheHttpClientTracingBuilder(openTelemetry); + public static ApacheHttpClientTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new ApacheHttpClientTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; private final ContextPropagators propagators; - ApacheHttpClientTracing( + ApacheHttpClientTelemetry( Instrumenter instrumenter, ContextPropagators propagators) { this.instrumenter = instrumenter; diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracingBuilder.java b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java similarity index 83% rename from instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracingBuilder.java rename to instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java index 5b344851aca2..88425f9e26c5 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTracingBuilder.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientTelemetryBuilder.java @@ -18,8 +18,8 @@ import java.util.List; import org.apache.http.HttpResponse; -/** A builder for {@link ApacheHttpClientTracing}. */ -public final class ApacheHttpClientTracingBuilder { +/** A builder for {@link ApacheHttpClientTelemetry}. */ +public final class ApacheHttpClientTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.apache-httpclient-4.3"; @@ -31,7 +31,7 @@ public final class ApacheHttpClientTracingBuilder { httpAttributesExtractorBuilder = HttpClientAttributesExtractor.builder(ApacheHttpClientHttpAttributesGetter.INSTANCE); - ApacheHttpClientTracingBuilder(OpenTelemetry openTelemetry) { + ApacheHttpClientTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -39,7 +39,7 @@ public final class ApacheHttpClientTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. The {@link AttributesExtractor} will be executed after all default extractors. */ - public ApacheHttpClientTracingBuilder addAttributeExtractor( + public ApacheHttpClientTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); @@ -51,7 +51,7 @@ public ApacheHttpClientTracingBuilder addAttributeExtractor( * * @param requestHeaders A list of HTTP header names. */ - public ApacheHttpClientTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public ApacheHttpClientTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -61,16 +61,16 @@ public ApacheHttpClientTracingBuilder setCapturedRequestHeaders(List req * * @param responseHeaders A list of HTTP header names. */ - public ApacheHttpClientTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public ApacheHttpClientTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link ApacheHttpClientTracing} configured with this {@link - * ApacheHttpClientTracingBuilder}. + * Returns a new {@link ApacheHttpClientTelemetry} configured with this {@link + * ApacheHttpClientTelemetryBuilder}. */ - public ApacheHttpClientTracing build() { + public ApacheHttpClientTelemetry build() { ApacheHttpClientHttpAttributesGetter httpAttributesGetter = ApacheHttpClientHttpAttributesGetter.INSTANCE; ApacheHttpClientNetAttributesGetter netAttributesGetter = @@ -88,6 +88,6 @@ public ApacheHttpClientTracing build() { // We manually inject because we need to inject internal requests for redirects. .newInstrumenter(SpanKindExtractor.alwaysClient()); - return new ApacheHttpClientTracing(instrumenter, openTelemetry.getPropagators()); + return new ApacheHttpClientTelemetry(instrumenter, openTelemetry.getPropagators()); } } diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestContextTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestContextTest.groovy index 17612f88e924..484544297b67 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestContextTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestContextTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientHostAbsoluteUriRequestContextTest extends AbstractApacheClientHostAbsoluteUriRequestContextTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestTest.groovy index 3185623123ce..eeb0416d67ec 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostAbsoluteUriRequestTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientHostAbsoluteUriRequestTest extends AbstractApacheClientHostAbsoluteUriRequestTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestContextTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestContextTest.groovy index dd40a466b66f..10df3785e934 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestContextTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestContextTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientHostRequestContextTest extends AbstractApacheClientHostRequestContextTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestTest.groovy index a778114f9cd4..311049fc93b0 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientHostRequestTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientHostRequestTest extends AbstractApacheClientHostRequestTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestContextTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestContextTest.groovy index fad40b39bb7b..9fd0072f7772 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestContextTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestContextTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientUriRequestContextTest extends AbstractApacheClientUriRequestContextTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestTest.groovy b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestTest.groovy index 91219b84ea5d..9b8c9e88b3c0 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestTest.groovy +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/test/groovy/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheClientUriRequestTest.groovy @@ -12,7 +12,7 @@ import org.apache.http.impl.client.CloseableHttpClient class ApacheClientUriRequestTest extends AbstractApacheClientUriRequestTest implements LibraryTestTrait { @Override protected CloseableHttpClient createClient(boolean readTimeout) { - def builder = ApacheHttpClientTracing.create(openTelemetry).newHttpClientBuilder() + def builder = ApacheHttpClientTelemetry.create(openTelemetry).newHttpClientBuilder() def requestConfigBuilder = RequestConfig.custom() .setMaxRedirects(maxRedirects()) .setConnectTimeout(CONNECT_TIMEOUT_MS) diff --git a/instrumentation/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ArmeriaSingletons.java b/instrumentation/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ArmeriaSingletons.java index 76caf37d9439..659ddbf61d1c 100644 --- a/instrumentation/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ArmeriaSingletons.java +++ b/instrumentation/armeria-1.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ArmeriaSingletons.java @@ -8,7 +8,7 @@ import com.linecorp.armeria.client.HttpClient; import com.linecorp.armeria.server.HttpService; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.armeria.v1_3.ArmeriaTracing; +import io.opentelemetry.instrumentation.armeria.v1_3.ArmeriaTelemetry; import java.util.function.Function; // Holds singleton references to decorators to match against during suppression. @@ -19,10 +19,10 @@ public final class ArmeriaSingletons { public static final Function SERVER_DECORATOR; static { - ArmeriaTracing tracing = ArmeriaTracing.create(GlobalOpenTelemetry.get()); + ArmeriaTelemetry telemetry = ArmeriaTelemetry.create(GlobalOpenTelemetry.get()); - CLIENT_DECORATOR = tracing.newClientDecorator(); - SERVER_DECORATOR = tracing.newServiceDecorator(); + CLIENT_DECORATOR = telemetry.newClientDecorator(); + SERVER_DECORATOR = telemetry.newServiceDecorator(); } private ArmeriaSingletons() {} diff --git a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracing.java b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetry.java similarity index 79% rename from instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracing.java rename to instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetry.java index 63ef42eb6874..94accffa1a73 100644 --- a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracing.java +++ b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetry.java @@ -14,22 +14,22 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import java.util.function.Function; -/** Entrypoint for tracing Armeria services or clients. */ -public final class ArmeriaTracing { +/** Entrypoint for instrumenting Armeria services or clients. */ +public final class ArmeriaTelemetry { - /** Returns a new {@link ArmeriaTracing} configured with the given {@link OpenTelemetry}. */ - public static ArmeriaTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link ArmeriaTelemetry} configured with the given {@link OpenTelemetry}. */ + public static ArmeriaTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - public static ArmeriaTracingBuilder builder(OpenTelemetry openTelemetry) { - return new ArmeriaTracingBuilder(openTelemetry); + public static ArmeriaTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new ArmeriaTelemetryBuilder(openTelemetry); } private final Instrumenter clientInstrumenter; private final Instrumenter serverInstrumenter; - ArmeriaTracing( + ArmeriaTelemetry( Instrumenter clientInstrumenter, Instrumenter serverInstrumenter) { this.clientInstrumenter = clientInstrumenter; diff --git a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracingBuilder.java b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java similarity index 90% rename from instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracingBuilder.java rename to instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java index 86c9aab83b5e..47c69edb9736 100644 --- a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTracingBuilder.java +++ b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaTelemetryBuilder.java @@ -33,7 +33,7 @@ import java.util.stream.Stream; import javax.annotation.Nullable; -public final class ArmeriaTracingBuilder { +public final class ArmeriaTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.armeria-1.3"; @@ -55,11 +55,11 @@ public final class ArmeriaTracingBuilder { ? extends SpanStatusExtractor> statusExtractorTransformer = Function.identity(); - ArmeriaTracingBuilder(OpenTelemetry openTelemetry) { + ArmeriaTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } - public ArmeriaTracingBuilder setStatusExtractor( + public ArmeriaTelemetryBuilder setStatusExtractor( Function< SpanStatusExtractor, ? extends SpanStatusExtractor> @@ -72,14 +72,14 @@ public ArmeriaTracingBuilder setStatusExtractor( * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. The {@link AttributesExtractor} will be executed after all default extractors. */ - public ArmeriaTracingBuilder addAttributeExtractor( + public ArmeriaTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; } /** Sets the {@code peer.service} attribute for http client spans. */ - public ArmeriaTracingBuilder setPeerService(String peerService) { + public ArmeriaTelemetryBuilder setPeerService(String peerService) { this.peerService = peerService; return this; } @@ -89,7 +89,7 @@ public ArmeriaTracingBuilder setPeerService(String peerService) { * * @param requestHeaders A list of HTTP header names. */ - public ArmeriaTracingBuilder setCapturedClientRequestHeaders(List requestHeaders) { + public ArmeriaTelemetryBuilder setCapturedClientRequestHeaders(List requestHeaders) { httpClientAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -99,7 +99,7 @@ public ArmeriaTracingBuilder setCapturedClientRequestHeaders(List reques * * @param responseHeaders A list of HTTP header names. */ - public ArmeriaTracingBuilder setCapturedClientResponseHeaders(List responseHeaders) { + public ArmeriaTelemetryBuilder setCapturedClientResponseHeaders(List responseHeaders) { httpClientAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } @@ -109,7 +109,7 @@ public ArmeriaTracingBuilder setCapturedClientResponseHeaders(List respo * * @param requestHeaders A list of HTTP header names. */ - public ArmeriaTracingBuilder setCapturedServerRequestHeaders(List requestHeaders) { + public ArmeriaTelemetryBuilder setCapturedServerRequestHeaders(List requestHeaders) { httpServerAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -119,12 +119,12 @@ public ArmeriaTracingBuilder setCapturedServerRequestHeaders(List reques * * @param responseHeaders A list of HTTP header names. */ - public ArmeriaTracingBuilder setCapturedServerResponseHeaders(List responseHeaders) { + public ArmeriaTelemetryBuilder setCapturedServerResponseHeaders(List responseHeaders) { httpServerAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } - public ArmeriaTracing build() { + public ArmeriaTelemetry build() { ArmeriaHttpClientAttributesGetter clientAttributesGetter = ArmeriaHttpClientAttributesGetter.INSTANCE; ArmeriaHttpServerAttributesGetter serverAttributesGetter = @@ -174,7 +174,7 @@ public ArmeriaTracing build() { PeerServiceAttributesExtractor.create(netClientAttributesGetter)); } - return new ArmeriaTracing( + return new ArmeriaTelemetry( clientInstrumenterBuilder.newClientInstrumenter(ClientRequestContextSetter.INSTANCE), serverInstrumenterBuilder.newServerInstrumenter(RequestContextGetter.INSTANCE)); } diff --git a/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpClientTest.java b/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpClientTest.java index 9bbee0a23664..a6f7f363cc6f 100644 --- a/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpClientTest.java +++ b/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpClientTest.java @@ -19,7 +19,7 @@ class ArmeriaHttpClientTest extends AbstractArmeriaHttpClientTest { @Override protected WebClientBuilder configureClient(WebClientBuilder clientBuilder) { return clientBuilder.decorator( - ArmeriaTracing.create(testing.getOpenTelemetry()).newClientDecorator()); + ArmeriaTelemetry.create(testing.getOpenTelemetry()).newClientDecorator()); } @Override diff --git a/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpServerTest.java b/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpServerTest.java index 9924fbaf424a..0faf2f0ec62f 100644 --- a/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpServerTest.java +++ b/instrumentation/armeria-1.3/library/src/test/java/io/opentelemetry/instrumentation/armeria/v1_3/ArmeriaHttpServerTest.java @@ -20,7 +20,7 @@ class ArmeriaHttpServerTest extends AbstractArmeriaHttpServerTest { @Override protected ServerBuilder configureServer(ServerBuilder sb) { return sb.decorator( - ArmeriaTracing.builder(testing.getOpenTelemetry()) + ArmeriaTelemetry.builder(testing.getOpenTelemetry()) .setCapturedServerRequestHeaders( Collections.singletonList(AbstractHttpServerTest.TEST_REQUEST_HEADER)) .setCapturedServerResponseHeaders( diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v1_11/TracingRequestHandler.java b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v1_11/TracingRequestHandler.java index 3f5a63496588..d7add08f2714 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v1_11/TracingRequestHandler.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v1_11/TracingRequestHandler.java @@ -14,7 +14,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTracing; +import io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTelemetry; /** * A {@link RequestHandler2} for use in the agent. Unlike library instrumentation, the agent will @@ -33,7 +33,7 @@ public class TracingRequestHandler extends RequestHandler2 { new HandlerContextKey<>(Scope.class.getName()); public static final RequestHandler2 tracingHandler = - AwsSdkTracing.builder(GlobalOpenTelemetry.get()) + AwsSdkTelemetry.builder(GlobalOpenTelemetry.get()) .setCaptureExperimentalSpanAttributes( Config.get() .getBoolean("otel.instrumentation.aws-sdk.experimental-span-attributes", false)) @@ -43,7 +43,7 @@ public class TracingRequestHandler extends RequestHandler2 { @Override public void beforeRequest(Request request) { tracingHandler.beforeRequest(request); - Context context = AwsSdkTracing.getOpenTelemetryContext(request); + Context context = AwsSdkTelemetry.getOpenTelemetryContext(request); // it is possible that context is not set by lib's handler if (context != null) { Scope scope = context.makeCurrent(); diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/autoconfigure/TracingRequestHandler.java b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/autoconfigure/TracingRequestHandler.java index f63d5a755d3a..477c0fc38132 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/autoconfigure/TracingRequestHandler.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/autoconfigure/TracingRequestHandler.java @@ -11,7 +11,7 @@ import com.amazonaws.handlers.RequestHandler2; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTracing; +import io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTelemetry; /** * A {@link RequestHandler2} for use as an SPI by the AWS SDK to automatically trace all requests. @@ -19,7 +19,7 @@ public class TracingRequestHandler extends RequestHandler2 { private static final RequestHandler2 DELEGATE = - AwsSdkTracing.builder(GlobalOpenTelemetry.get()) + AwsSdkTelemetry.builder(GlobalOpenTelemetry.get()) .setCaptureExperimentalSpanAttributes( Config.get() .getBoolean("otel.instrumentation.aws-sdk.experimental-span-attributes", false)) diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracing.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetry.java similarity index 77% rename from instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracing.java rename to instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetry.java index 25d02de6fd4b..37e5108be85f 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracing.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetry.java @@ -13,7 +13,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; /** - * Entrypoint for tracing AWS SDK v1 clients. + * Entrypoint for instrumenting AWS SDK v1 clients. * *

AWS SDK v1 is quite old and has some known bugs that are not fixed due to possible backwards * compatibility issues. Notably, if a {@link RequestHandler2} throws an exception in a callback, @@ -21,7 +21,7 @@ * ensure you do not register any problematic {@link RequestHandler2}s on your clients or you will * witness broken traces. */ -public class AwsSdkTracing { +public class AwsSdkTelemetry { /** * Returns the OpenTelemetry {@link Context} stored in the {@link Request}, or {@code null} if @@ -32,20 +32,22 @@ public static Context getOpenTelemetryContext(Request request) { return request.getHandlerContext(TracingRequestHandler.CONTEXT); } - /** Returns a new {@link AwsSdkTracing} configured with the given {@link OpenTelemetry}. */ - public static AwsSdkTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link AwsSdkTelemetry} configured with the given {@link OpenTelemetry}. */ + public static AwsSdkTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link AwsSdkTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static AwsSdkTracingBuilder builder(OpenTelemetry openTelemetry) { - return new AwsSdkTracingBuilder(openTelemetry); + /** + * Returns a new {@link AwsSdkTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static AwsSdkTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new AwsSdkTelemetryBuilder(openTelemetry); } private final Instrumenter, Response> requestInstrumenter; private final Instrumenter, Response> consumerInstrumenter; - AwsSdkTracing(OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes) { + AwsSdkTelemetry(OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes) { requestInstrumenter = AwsSdkInstrumenterFactory.requestInstrumenter( openTelemetry, captureExperimentalSpanAttributes); diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracingBuilder.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetryBuilder.java similarity index 63% rename from instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracingBuilder.java rename to instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetryBuilder.java index e031928025b4..c0e270dea2c8 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTracingBuilder.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkTelemetryBuilder.java @@ -7,14 +7,14 @@ import io.opentelemetry.api.OpenTelemetry; -/** A builder of {@link AwsSdkTracing}. */ -public class AwsSdkTracingBuilder { +/** A builder of {@link AwsSdkTelemetry}. */ +public class AwsSdkTelemetryBuilder { private final OpenTelemetry openTelemetry; private boolean captureExperimentalSpanAttributes; - AwsSdkTracingBuilder(OpenTelemetry openTelemetry) { + AwsSdkTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -23,14 +23,16 @@ public class AwsSdkTracingBuilder { * removed in the future, so only enable this if you know you do not require attributes filled by * this instrumentation to be stable across versions */ - public AwsSdkTracingBuilder setCaptureExperimentalSpanAttributes( + public AwsSdkTelemetryBuilder setCaptureExperimentalSpanAttributes( boolean captureExperimentalSpanAttributes) { this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes; return this; } - /** Returns a new {@link AwsSdkTracing} with the settings of this {@link AwsSdkTracingBuilder}. */ - public AwsSdkTracing build() { - return new AwsSdkTracing(openTelemetry, captureExperimentalSpanAttributes); + /** + * Returns a new {@link AwsSdkTelemetry} with the settings of this {@link AwsSdkTelemetryBuilder}. + */ + public AwsSdkTelemetry build() { + return new AwsSdkTelemetry(openTelemetry, captureExperimentalSpanAttributes); } } diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/Aws1ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/Aws1ClientTest.groovy index 4d53bbc078e2..3fa3506617f6 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/Aws1ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/Aws1ClientTest.groovy @@ -11,7 +11,7 @@ class Aws1ClientTest extends AbstractAws1ClientTest implements LibraryTestTrait @Override def configureClient(def client) { client.withRequestHandlers( - AwsSdkTracing.builder(getOpenTelemetry()) + AwsSdkTelemetry.builder(getOpenTelemetry()) .setCaptureExperimentalSpanAttributes(true) .build() .newRequestHandler()) diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/SqsTracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/SqsTracingTest.groovy index a5539a544343..8f1083b796e7 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/SqsTracingTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/SqsTracingTest.groovy @@ -12,7 +12,7 @@ class SqsTracingTest extends AbstractSqsTracingTest implements LibraryTestTrait @Override AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) { return client.withRequestHandlers( - AwsSdkTracing.builder(getOpenTelemetry()) + AwsSdkTelemetry.builder(getOpenTelemetry()) .setCaptureExperimentalSpanAttributes(true) .build() .newRequestHandler()) diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/TracingExecutionInterceptor.java b/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/TracingExecutionInterceptor.java index b2400c561aac..919bb84b2e03 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/TracingExecutionInterceptor.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/TracingExecutionInterceptor.java @@ -7,7 +7,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdkTracing; +import io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdkTelemetry; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Optional; @@ -32,7 +32,7 @@ public class TracingExecutionInterceptor implements ExecutionInterceptor { Config.get().getBoolean("otel.instrumentation.aws-sdk.experimental-span-attributes", false); private final ExecutionInterceptor delegate = - AwsSdkTracing.builder(GlobalOpenTelemetry.get()) + AwsSdkTelemetry.builder(GlobalOpenTelemetry.get()) .setCaptureExperimentalSpanAttributes(CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) .build() .newExecutionInterceptor(); diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracing.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetry.java similarity index 72% rename from instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracing.java rename to instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetry.java index ca64bae3ee21..73562f4e8ca6 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracing.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetry.java @@ -20,27 +20,29 @@ *

{@code
  * DynamoDbClient dynamoDb = DynamoDbClient.builder()
  *     .overrideConfiguration(ClientOverrideConfiguration.builder()
- *         .addExecutionInterceptor(AwsSdkTracing.create(openTelemetry).newExecutionInterceptor())
+ *         .addExecutionInterceptor(AwsSdkTelemetry.create(openTelemetry).newExecutionInterceptor())
  *         .build())
  *     .build();
  * }
*/ -public class AwsSdkTracing { +public class AwsSdkTelemetry { - /** Returns a new {@link AwsSdkTracing} configured with the given {@link OpenTelemetry}. */ - public static AwsSdkTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link AwsSdkTelemetry} configured with the given {@link OpenTelemetry}. */ + public static AwsSdkTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link AwsSdkTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static AwsSdkTracingBuilder builder(OpenTelemetry openTelemetry) { - return new AwsSdkTracingBuilder(openTelemetry); + /** + * Returns a new {@link AwsSdkTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static AwsSdkTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new AwsSdkTelemetryBuilder(openTelemetry); } private final Instrumenter tracer; private final boolean captureExperimentalSpanAttributes; - AwsSdkTracing(OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes) { + AwsSdkTelemetry(OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes) { this.tracer = AwsSdkInstrumenterFactory.createInstrumenter( openTelemetry, captureExperimentalSpanAttributes); diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracingBuilder.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetryBuilder.java similarity index 63% rename from instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracingBuilder.java rename to instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetryBuilder.java index f008d7805af3..05b46f06a8f7 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTracingBuilder.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkTelemetryBuilder.java @@ -7,14 +7,14 @@ import io.opentelemetry.api.OpenTelemetry; -/** A builder of {@link AwsSdkTracing}. */ -public final class AwsSdkTracingBuilder { +/** A builder of {@link AwsSdkTelemetry}. */ +public final class AwsSdkTelemetryBuilder { private final OpenTelemetry openTelemetry; private boolean captureExperimentalSpanAttributes; - AwsSdkTracingBuilder(OpenTelemetry openTelemetry) { + AwsSdkTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -23,14 +23,16 @@ public final class AwsSdkTracingBuilder { * removed in the future, so only enable this if you know you do not require attributes filled by * this instrumentation to be stable across versions */ - public AwsSdkTracingBuilder setCaptureExperimentalSpanAttributes( + public AwsSdkTelemetryBuilder setCaptureExperimentalSpanAttributes( boolean captureExperimentalSpanAttributes) { this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes; return this; } - /** Returns a new {@link AwsSdkTracing} with the settings of this {@link AwsSdkTracingBuilder}. */ - public AwsSdkTracing build() { - return new AwsSdkTracing(openTelemetry, captureExperimentalSpanAttributes); + /** + * Returns a new {@link AwsSdkTelemetry} with the settings of this {@link AwsSdkTelemetryBuilder}. + */ + public AwsSdkTelemetry build() { + return new AwsSdkTelemetry(openTelemetry, captureExperimentalSpanAttributes); } } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy index 598167a5c58e..9e4fb90c883d 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/test/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/Aws2ClientTest.groovy @@ -13,7 +13,7 @@ class Aws2ClientTest extends AbstractAws2ClientTest implements LibraryTestTrait ClientOverrideConfiguration.Builder createOverrideConfigurationBuilder() { return ClientOverrideConfiguration.builder() .addExecutionInterceptor( - AwsSdkTracing.builder(getOpenTelemetry()) + AwsSdkTelemetry.builder(getOpenTelemetry()) .setCaptureExperimentalSpanAttributes(true) .build() .newExecutionInterceptor()) diff --git a/instrumentation/graphql-java-12.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/graphql/GraphqlSingletons.java b/instrumentation/graphql-java-12.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/graphql/GraphqlSingletons.java index 9ce612fe73be..bafbf5e85e14 100644 --- a/instrumentation/graphql-java-12.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/graphql/GraphqlSingletons.java +++ b/instrumentation/graphql-java-12.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/graphql/GraphqlSingletons.java @@ -9,7 +9,7 @@ import graphql.execution.instrumentation.Instrumentation; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.graphql.GraphQLTracing; +import io.opentelemetry.instrumentation.graphql.GraphQLTelemetry; import java.util.ArrayList; import java.util.List; @@ -20,8 +20,8 @@ public final class GraphqlSingletons { private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES = Config.get().getBoolean("otel.instrumentation.graphql.experimental-span-attributes", false); - private static final GraphQLTracing TRACING = - GraphQLTracing.builder(GlobalOpenTelemetry.get()) + private static final GraphQLTelemetry TELEMETRY = + GraphQLTelemetry.builder(GlobalOpenTelemetry.get()) .setCaptureExperimentalSpanAttributes(CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) .setSanitizeQuery(QUERY_SANITIZATION_ENABLED) .build(); @@ -29,7 +29,7 @@ public final class GraphqlSingletons { private GraphqlSingletons() {} public static Instrumentation addInstrumentation(Instrumentation instrumentation) { - Instrumentation ourInstrumentation = TRACING.newInstrumentation(); + Instrumentation ourInstrumentation = TELEMETRY.newInstrumentation(); if (instrumentation == null) { return ourInstrumentation; } diff --git a/instrumentation/graphql-java-12.0/library/README.md b/instrumentation/graphql-java-12.0/library/README.md index f258a65956e9..efe6ea404d84 100644 --- a/instrumentation/graphql-java-12.0/library/README.md +++ b/instrumentation/graphql-java-12.0/library/README.md @@ -35,7 +35,7 @@ added to an instance of the `GraphQL` to provide OpenTelemetry-based spans. ```java void configure(OpenTelemetry openTelemetry, GraphQL.Builder builder) { - GraphQLTracing tracing = GraphQLTracing.builder(openTelemetry).build(); - builder.instrumentation(tracing.newInstrumentation()); + GraphQLTelemetry telemetry = GraphQLTelemetry.builder(openTelemetry).build(); + builder.instrumentation(telemetry.newInstrumentation()); } ``` diff --git a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracing.java b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java similarity index 83% rename from instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracing.java rename to instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java index 3404d49bc8a4..208f0ef1b363 100644 --- a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracing.java +++ b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetry.java @@ -15,26 +15,26 @@ import io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor; @SuppressWarnings("AbbreviationAsWordInName") -public final class GraphQLTracing { +public final class GraphQLTelemetry { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.graphql-java-12.0"; - /** Returns a new {@link GraphQLTracing} configured with the given {@link OpenTelemetry}. */ - public static GraphQLTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link GraphQLTelemetry} configured with the given {@link OpenTelemetry}. */ + public static GraphQLTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link GraphQLTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link GraphQLTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ - public static GraphQLTracingBuilder builder(OpenTelemetry openTelemetry) { - return new GraphQLTracingBuilder(openTelemetry); + public static GraphQLTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new GraphQLTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; private final boolean captureExperimentalSpanAttributes; private final boolean sanitizeQuery; - GraphQLTracing( + GraphQLTelemetry( OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes, boolean sanitizeQuery) { diff --git a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracingBuilder.java b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetryBuilder.java similarity index 65% rename from instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracingBuilder.java rename to instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetryBuilder.java index 45d1fcdc04dd..88a9c2cab023 100644 --- a/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTracingBuilder.java +++ b/instrumentation/graphql-java-12.0/library/src/main/java/io/opentelemetry/instrumentation/graphql/GraphQLTelemetryBuilder.java @@ -7,16 +7,16 @@ import io.opentelemetry.api.OpenTelemetry; -/** A builder of {@link GraphQLTracing}. */ +/** A builder of {@link GraphQLTelemetry}. */ @SuppressWarnings("AbbreviationAsWordInName") -public final class GraphQLTracingBuilder { +public final class GraphQLTelemetryBuilder { private final OpenTelemetry openTelemetry; private boolean captureExperimentalSpanAttributes; private boolean sanitizeQuery = true; - GraphQLTracingBuilder(OpenTelemetry openTelemetry) { + GraphQLTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -25,22 +25,23 @@ public final class GraphQLTracingBuilder { * removed in the future, so only enable this if you know you do not require attributes filled by * this instrumentation to be stable across versions. */ - public GraphQLTracingBuilder setCaptureExperimentalSpanAttributes( + public GraphQLTelemetryBuilder setCaptureExperimentalSpanAttributes( boolean captureExperimentalSpanAttributes) { this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes; return this; } /** Sets whether sensitive information should be removed from queries. Default is {@code true}. */ - public GraphQLTracingBuilder setSanitizeQuery(boolean sanitizeQuery) { + public GraphQLTelemetryBuilder setSanitizeQuery(boolean sanitizeQuery) { this.sanitizeQuery = sanitizeQuery; return this; } /** - * Returns a new {@link GraphQLTracing} with the settings of this {@link GraphQLTracingBuilder}. + * Returns a new {@link GraphQLTelemetry} with the settings of this {@link + * GraphQLTelemetryBuilder}. */ - public GraphQLTracing build() { - return new GraphQLTracing(openTelemetry, captureExperimentalSpanAttributes, sanitizeQuery); + public GraphQLTelemetry build() { + return new GraphQLTelemetry(openTelemetry, captureExperimentalSpanAttributes, sanitizeQuery); } } diff --git a/instrumentation/graphql-java-12.0/library/src/test/java/io/opentelemetry/instrumentation/graphql/GraphqlTest.java b/instrumentation/graphql-java-12.0/library/src/test/java/io/opentelemetry/instrumentation/graphql/GraphqlTest.java index cc9e18c8d218..d4a80cf93dc0 100644 --- a/instrumentation/graphql-java-12.0/library/src/test/java/io/opentelemetry/instrumentation/graphql/GraphqlTest.java +++ b/instrumentation/graphql-java-12.0/library/src/test/java/io/opentelemetry/instrumentation/graphql/GraphqlTest.java @@ -22,10 +22,10 @@ protected InstrumentationExtension getTesting() { @Override protected void configure(GraphQL.Builder builder) { - GraphQLTracing tracing = - GraphQLTracing.builder(testing.getOpenTelemetry()) + GraphQLTelemetry telemetry = + GraphQLTelemetry.builder(testing.getOpenTelemetry()) .setCaptureExperimentalSpanAttributes(true) .build(); - builder.instrumentation(tracing.newInstrumentation()); + builder.instrumentation(telemetry.newInstrumentation()); } } diff --git a/instrumentation/grpc-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons.java b/instrumentation/grpc-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons.java index 188613d6a769..e8ec8ba87fd5 100644 --- a/instrumentation/grpc-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons.java +++ b/instrumentation/grpc-1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grpc/v1_6/GrpcSingletons.java @@ -10,7 +10,7 @@ import io.grpc.ServerInterceptor; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.grpc.v1_6.GrpcTracing; +import io.opentelemetry.instrumentation.grpc.v1_6.GrpcTelemetry; import io.opentelemetry.instrumentation.grpc.v1_6.internal.ContextStorageBridge; // Holds singleton references. @@ -26,13 +26,13 @@ public final class GrpcSingletons { boolean experimentalSpanAttributes = Config.get().getBoolean("otel.instrumentation.grpc.experimental-span-attributes", false); - GrpcTracing tracing = - GrpcTracing.builder(GlobalOpenTelemetry.get()) + GrpcTelemetry telemetry = + GrpcTelemetry.builder(GlobalOpenTelemetry.get()) .setCaptureExperimentalSpanAttributes(experimentalSpanAttributes) .build(); - CLIENT_INTERCEPTOR = tracing.newClientInterceptor(); - SERVER_INTERCEPTOR = tracing.newServerInterceptor(); + CLIENT_INTERCEPTOR = telemetry.newClientInterceptor(); + SERVER_INTERCEPTOR = telemetry.newServerInterceptor(); } private GrpcSingletons() {} diff --git a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracing.java b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetry.java similarity index 77% rename from instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracing.java rename to instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetry.java index c0a0fd4fdd6d..dbef4b539fe1 100644 --- a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracing.java +++ b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetry.java @@ -12,17 +12,17 @@ import io.opentelemetry.context.propagation.ContextPropagators; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; -/** Entrypoint for tracing gRPC servers or clients. */ -public final class GrpcTracing { +/** Entrypoint for instrumenting gRPC servers or clients. */ +public final class GrpcTelemetry { - /** Returns a new {@link GrpcTracing} configured with the given {@link OpenTelemetry}. */ - public static GrpcTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link GrpcTelemetry} configured with the given {@link OpenTelemetry}. */ + public static GrpcTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link GrpcTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static GrpcTracingBuilder builder(OpenTelemetry openTelemetry) { - return new GrpcTracingBuilder(openTelemetry); + /** Returns a new {@link GrpcTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ + public static GrpcTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new GrpcTelemetryBuilder(openTelemetry); } private final Instrumenter serverInstrumenter; @@ -30,7 +30,7 @@ public static GrpcTracingBuilder builder(OpenTelemetry openTelemetry) { private final ContextPropagators propagators; private final boolean captureExperimentalSpanAttributes; - GrpcTracing( + GrpcTelemetry( Instrumenter serverInstrumenter, Instrumenter clientInstrumenter, ContextPropagators propagators, diff --git a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracingBuilder.java b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java similarity index 91% rename from instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracingBuilder.java rename to instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java index 788d407dfce4..838cccf91cb4 100644 --- a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTracingBuilder.java +++ b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTelemetryBuilder.java @@ -26,8 +26,8 @@ import java.util.stream.Stream; import javax.annotation.Nullable; -/** A builder of {@link GrpcTracing}. */ -public final class GrpcTracingBuilder { +/** A builder of {@link GrpcTelemetry}. */ +public final class GrpcTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.grpc-1.6"; @@ -47,7 +47,7 @@ public final class GrpcTracingBuilder { private boolean captureExperimentalSpanAttributes; - GrpcTracingBuilder(OpenTelemetry openTelemetry) { + GrpcTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -55,14 +55,14 @@ public final class GrpcTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. The {@link AttributesExtractor} will be executed after all default extractors. */ - public GrpcTracingBuilder addAttributeExtractor( + public GrpcTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; } /** Sets custom client {@link SpanNameExtractor} via transform function. */ - public GrpcTracingBuilder setClientSpanNameExtractor( + public GrpcTelemetryBuilder setClientSpanNameExtractor( Function, ? extends SpanNameExtractor> clientSpanNameExtractor) { this.clientSpanNameExtractorTransformer = clientSpanNameExtractor; @@ -70,7 +70,7 @@ public GrpcTracingBuilder setClientSpanNameExtractor( } /** Sets custom server {@link SpanNameExtractor} via transform function. */ - public GrpcTracingBuilder setServerSpanNameExtractor( + public GrpcTelemetryBuilder setServerSpanNameExtractor( Function, ? extends SpanNameExtractor> serverSpanNameExtractor) { this.serverSpanNameExtractorTransformer = serverSpanNameExtractor; @@ -78,7 +78,7 @@ public GrpcTracingBuilder setServerSpanNameExtractor( } /** Sets the {@code peer.service} attribute for http client spans. */ - public GrpcTracingBuilder setPeerService(String peerService) { + public GrpcTelemetryBuilder setPeerService(String peerService) { this.peerService = peerService; return this; } @@ -88,14 +88,14 @@ public GrpcTracingBuilder setPeerService(String peerService) { * removed in the future, so only enable this if you know you do not require attributes filled by * this instrumentation to be stable across versions */ - public GrpcTracingBuilder setCaptureExperimentalSpanAttributes( + public GrpcTelemetryBuilder setCaptureExperimentalSpanAttributes( boolean captureExperimentalSpanAttributes) { this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes; return this; } - /** Returns a new {@link GrpcTracing} with the settings of this {@link GrpcTracingBuilder}. */ - public GrpcTracing build() { + /** Returns a new {@link GrpcTelemetry} with the settings of this {@link GrpcTelemetryBuilder}. */ + public GrpcTelemetry build() { SpanNameExtractor originalSpanNameExtractor = new GrpcSpanNameExtractor(); SpanNameExtractor clientSpanNameExtractor = originalSpanNameExtractor; @@ -140,7 +140,7 @@ public GrpcTracing build() { PeerServiceAttributesExtractor.create(netClientAttributesGetter)); } - return new GrpcTracing( + return new GrpcTelemetry( serverInstrumenterBuilder.newServerInstrumenter(GrpcRequestGetter.INSTANCE), // gRPC client interceptors require two phases, one to set up request and one to execute. // So we go ahead and inject manually in this instrumentation. diff --git a/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcStreamingTest.java b/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcStreamingTest.java index 6642a31e260f..5826e79fcc0b 100644 --- a/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcStreamingTest.java +++ b/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcStreamingTest.java @@ -18,12 +18,14 @@ class GrpcStreamingTest extends AbstractGrpcStreamingTest { @Override protected ServerBuilder configureServer(ServerBuilder server) { - return server.intercept(GrpcTracing.create(testing.getOpenTelemetry()).newServerInterceptor()); + return server.intercept( + GrpcTelemetry.create(testing.getOpenTelemetry()).newServerInterceptor()); } @Override protected ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { - return client.intercept(GrpcTracing.create(testing.getOpenTelemetry()).newClientInterceptor()); + return client.intercept( + GrpcTelemetry.create(testing.getOpenTelemetry()).newClientInterceptor()); } @Override diff --git a/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTest.java b/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTest.java index a8b7d70ee46f..2dcd78608c86 100644 --- a/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTest.java +++ b/instrumentation/grpc-1.6/library/src/test/java/io/opentelemetry/instrumentation/grpc/v1_6/GrpcTest.java @@ -18,12 +18,14 @@ class GrpcTest extends AbstractGrpcTest { @Override protected ServerBuilder configureServer(ServerBuilder server) { - return server.intercept(GrpcTracing.create(testing.getOpenTelemetry()).newServerInterceptor()); + return server.intercept( + GrpcTelemetry.create(testing.getOpenTelemetry()).newServerInterceptor()); } @Override protected ManagedChannelBuilder configureClient(ManagedChannelBuilder client) { - return client.intercept(GrpcTracing.create(testing.getOpenTelemetry()).newClientInterceptor()); + return client.intercept( + GrpcTelemetry.create(testing.getOpenTelemetry()).newClientInterceptor()); } @Override diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetry.java b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetry.java new file mode 100644 index 000000000000..bc957df5ab23 --- /dev/null +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetry.java @@ -0,0 +1,37 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.jetty.httpclient.v9_2; + +import io.opentelemetry.api.OpenTelemetry; +import org.eclipse.jetty.client.HttpClient; + +/** Entrypoint for instrumenting Jetty client. */ +public final class JettyClientTelemetry { + + /** Returns a new {@link JettyClientTelemetry} configured with the given {@link OpenTelemetry}. */ + public static JettyClientTelemetry create(OpenTelemetry openTelemetry) { + JettyClientTelemetryBuilder builder = builder(openTelemetry); + return builder.build(); + } + + /** + * Returns a new {@link JettyClientTelemetryBuilder} configured with the given {@link + * OpenTelemetry}. + */ + public static JettyClientTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new JettyClientTelemetryBuilder(openTelemetry); + } + + private final HttpClient httpClient; + + JettyClientTelemetry(HttpClient httpClient) { + this.httpClient = httpClient; + } + + public HttpClient getHttpClient() { + return httpClient; + } +} diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracingBuilder.java b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetryBuilder.java similarity index 70% rename from instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracingBuilder.java rename to instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetryBuilder.java index 0082dff71763..e67c9495d940 100644 --- a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracingBuilder.java +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTelemetryBuilder.java @@ -14,23 +14,24 @@ import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.util.ssl.SslContextFactory; -/** A builder of {@link JettyClientTracing}. */ -public final class JettyClientTracingBuilder { +/** A builder of {@link JettyClientTelemetry}. */ +public final class JettyClientTelemetryBuilder { private final JettyClientInstrumenterBuilder instrumenterBuilder; private HttpClientTransport httpClientTransport; private SslContextFactory sslContextFactory; - JettyClientTracingBuilder(OpenTelemetry openTelemetry) { + JettyClientTelemetryBuilder(OpenTelemetry openTelemetry) { instrumenterBuilder = new JettyClientInstrumenterBuilder(openTelemetry); } - public JettyClientTracingBuilder setHttpClientTransport(HttpClientTransport httpClientTransport) { + public JettyClientTelemetryBuilder setHttpClientTransport( + HttpClientTransport httpClientTransport) { this.httpClientTransport = httpClientTransport; return this; } - public JettyClientTracingBuilder setSslContextFactory(SslContextFactory sslContextFactory) { + public JettyClientTelemetryBuilder setSslContextFactory(SslContextFactory sslContextFactory) { this.sslContextFactory = sslContextFactory; return this; } @@ -39,7 +40,7 @@ public JettyClientTracingBuilder setSslContextFactory(SslContextFactory sslConte * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public JettyClientTracingBuilder addAttributeExtractor( + public JettyClientTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { instrumenterBuilder.addAttributeExtractor(attributesExtractor); return this; @@ -50,7 +51,7 @@ public JettyClientTracingBuilder addAttributeExtractor( * * @param requestHeaders A list of HTTP header names. */ - public JettyClientTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public JettyClientTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { instrumenterBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -60,20 +61,20 @@ public JettyClientTracingBuilder setCapturedRequestHeaders(List requestH * * @param responseHeaders A list of HTTP header names. */ - public JettyClientTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public JettyClientTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { instrumenterBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link JettyClientTracing} with the settings of this {@link - * JettyClientTracingBuilder}. + * Returns a new {@link JettyClientTelemetry} with the settings of this {@link + * JettyClientTelemetryBuilder}. */ - public JettyClientTracing build() { + public JettyClientTelemetry build() { TracingHttpClient tracingHttpClient = TracingHttpClient.buildNew( instrumenterBuilder.build(), this.sslContextFactory, this.httpClientTransport); - return new JettyClientTracing(tracingHttpClient); + return new JettyClientTelemetry(tracingHttpClient); } } diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracing.java b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracing.java deleted file mode 100644 index 1c5ed206a9e0..000000000000 --- a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyClientTracing.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.instrumentation.jetty.httpclient.v9_2; - -import io.opentelemetry.api.OpenTelemetry; -import org.eclipse.jetty.client.HttpClient; - -/** JettyClientTracing, the Entrypoint for tracing Jetty client. */ -public final class JettyClientTracing { - - /** Returns a new {@link JettyClientTracing} configured with the given {@link OpenTelemetry}. */ - public static JettyClientTracing create(OpenTelemetry openTelemetry) { - JettyClientTracingBuilder builder = builder(openTelemetry); - return builder.build(); - } - - /** - * Returns a new {@link JettyClientTracingBuilder} configured with the given {@link - * OpenTelemetry}. - */ - public static JettyClientTracingBuilder builder(OpenTelemetry openTelemetry) { - return new JettyClientTracingBuilder(openTelemetry); - } - - private final HttpClient httpClient; - - JettyClientTracing(HttpClient httpClient) { - this.httpClient = httpClient; - } - - public HttpClient getHttpClient() { - return httpClient; - } -} diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/test/groovy/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9LibraryTest.groovy b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/test/groovy/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9LibraryTest.groovy index 2cd255c6d1ca..6815e130b5ef 100644 --- a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/test/groovy/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9LibraryTest.groovy +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/test/groovy/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9LibraryTest.groovy @@ -14,12 +14,12 @@ class JettyHttpClient9LibraryTest extends AbstractJettyClient9Test implements Li @Override HttpClient createStandardClient() { - return JettyClientTracing.create(getOpenTelemetry()).getHttpClient() + return JettyClientTelemetry.create(getOpenTelemetry()).getHttpClient() } @Override HttpClient createHttpsClient(SslContextFactory sslContextFactory) { - return JettyClientTracing.builder(getOpenTelemetry()) + return JettyClientTelemetry.builder(getOpenTelemetry()) .setSslContextFactory(sslContextFactory) .build() .getHttpClient() diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetry.java similarity index 92% rename from instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java rename to instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetry.java index b6acf5e2b278..963aa8739b0e 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetry.java @@ -28,8 +28,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public final class KafkaTracing { - private static final Logger logger = LoggerFactory.getLogger(KafkaTracing.class); +public final class KafkaTelemetry { + private static final Logger logger = LoggerFactory.getLogger(KafkaTelemetry.class); private static final TextMapGetter> GETTER = KafkaConsumerRecordGetter.INSTANCE; @@ -40,7 +40,7 @@ public final class KafkaTracing { private final Instrumenter, Void> producerInstrumenter; private final Instrumenter, Void> consumerProcessInstrumenter; - KafkaTracing( + KafkaTelemetry( OpenTelemetry openTelemetry, Instrumenter, Void> producerInstrumenter, Instrumenter, Void> consumerProcessInstrumenter) { @@ -49,14 +49,16 @@ public final class KafkaTracing { this.consumerProcessInstrumenter = consumerProcessInstrumenter; } - /** Returns a new {@link KafkaTracing} configured with the given {@link OpenTelemetry}. */ - public static KafkaTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link KafkaTelemetry} configured with the given {@link OpenTelemetry}. */ + public static KafkaTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link KafkaTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static KafkaTracingBuilder builder(OpenTelemetry openTelemetry) { - return new KafkaTracingBuilder(openTelemetry); + /** + * Returns a new {@link KafkaTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static KafkaTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new KafkaTelemetryBuilder(openTelemetry); } private TextMapPropagator propagator() { diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetryBuilder.java similarity index 85% rename from instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java rename to instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetryBuilder.java index c3bcbc854f97..64a2ca658a39 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTelemetryBuilder.java @@ -15,7 +15,7 @@ import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.producer.ProducerRecord; -public final class KafkaTracingBuilder { +public final class KafkaTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.kafka-clients-0.11"; private final OpenTelemetry openTelemetry; @@ -24,24 +24,24 @@ public final class KafkaTracingBuilder { private final List, Void>> consumerAttributesExtractors = new ArrayList<>(); - KafkaTracingBuilder(OpenTelemetry openTelemetry) { + KafkaTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = Objects.requireNonNull(openTelemetry); } - public KafkaTracingBuilder addProducerAttributesExtractors( + public KafkaTelemetryBuilder addProducerAttributesExtractors( AttributesExtractor, Void> extractor) { producerAttributesExtractors.add(extractor); return this; } - public KafkaTracingBuilder addConsumerAttributesExtractors( + public KafkaTelemetryBuilder addConsumerAttributesExtractors( AttributesExtractor, Void> extractor) { consumerAttributesExtractors.add(extractor); return this; } - public KafkaTracing build() { - return new KafkaTracing( + public KafkaTelemetry build() { + return new KafkaTelemetry( openTelemetry, KafkaInstrumenterFactory.createProducerInstrumenter( INSTRUMENTATION_NAME, openTelemetry, producerAttributesExtractors), diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumer.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumer.java index 6d000f6bf75d..857f438d60b3 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumer.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumer.java @@ -26,11 +26,11 @@ class TracingConsumer implements Consumer { private final Consumer consumer; - private final KafkaTracing tracing; + private final KafkaTelemetry telemetry; - TracingConsumer(Consumer consumer, KafkaTracing tracing) { + TracingConsumer(Consumer consumer, KafkaTelemetry telemetry) { this.consumer = consumer; - this.tracing = tracing; + this.telemetry = telemetry; } @Override @@ -82,7 +82,7 @@ public ConsumerRecords poll(long timeout) { @Override public ConsumerRecords poll(Duration duration) { ConsumerRecords records = consumer.poll(duration); - tracing.buildAndFinishSpan(records); + telemetry.buildAndFinishSpan(records); return records; } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java index 4620befd8972..cfab0204b05d 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java @@ -19,11 +19,11 @@ */ public class TracingConsumerInterceptor implements ConsumerInterceptor { - private static final KafkaTracing tracing = KafkaTracing.create(GlobalOpenTelemetry.get()); + private static final KafkaTelemetry telemetry = KafkaTelemetry.create(GlobalOpenTelemetry.get()); @Override public ConsumerRecords onConsume(ConsumerRecords records) { - tracing.buildAndFinishSpan(records); + telemetry.buildAndFinishSpan(records); return records; } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducer.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducer.java index 951b295ce4b9..f6c6551b01b1 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducer.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducer.java @@ -22,11 +22,11 @@ class TracingProducer implements Producer { private final Producer producer; - private final KafkaTracing tracing; + private final KafkaTelemetry telemetry; - TracingProducer(Producer producer, KafkaTracing tracing) { + TracingProducer(Producer producer, KafkaTelemetry telemetry) { this.producer = producer; - this.tracing = tracing; + this.telemetry = telemetry; } @Override @@ -68,7 +68,7 @@ public Future send(ProducerRecord record) { @Override public Future send(ProducerRecord record, Callback callback) { - return tracing.buildAndInjectSpan(record, callback, producer::send); + return telemetry.buildAndInjectSpan(record, callback, producer::send); } @Override diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducerInterceptor.java b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducerInterceptor.java index c016f4842b73..655aebfa0207 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducerInterceptor.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducerInterceptor.java @@ -18,11 +18,11 @@ */ public class TracingProducerInterceptor implements ProducerInterceptor { - private static final KafkaTracing tracing = KafkaTracing.create(GlobalOpenTelemetry.get()); + private static final KafkaTelemetry telemetry = KafkaTelemetry.create(GlobalOpenTelemetry.get()); @Override public ProducerRecord onSend(ProducerRecord producerRecord) { - tracing.buildAndInjectSpan(producerRecord); + telemetry.buildAndInjectSpan(producerRecord); return producerRecord; } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/groovy/io/opentelemetry/instrumentation/kafkaclients/WrappersTest.groovy b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/groovy/io/opentelemetry/instrumentation/kafkaclients/WrappersTest.groovy index ed45726dcee4..07d88f147c85 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/groovy/io/opentelemetry/instrumentation/kafkaclients/WrappersTest.groovy +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/groovy/io/opentelemetry/instrumentation/kafkaclients/WrappersTest.groovy @@ -20,11 +20,11 @@ class WrappersTest extends KafkaClientBaseTest implements LibraryTestTrait { @Unroll def "test wrappers"() throws Exception { - KafkaTracing tracing = KafkaTracing.create(getOpenTelemetry()) + KafkaTelemetry telemetry = KafkaTelemetry.create(getOpenTelemetry()) when: String greeting = "Hello Kafka!" - def wrappedProducer = tracing.wrap(producer) + def wrappedProducer = telemetry.wrap(producer) runWithSpan("parent") { wrappedProducer.send(new ProducerRecord(SHARED_TOPIC, greeting)) { meta, ex -> if (ex == null) { @@ -38,7 +38,7 @@ class WrappersTest extends KafkaClientBaseTest implements LibraryTestTrait { then: awaitUntilConsumerIsReady() // check that the message was received - def wrappedConsumer = tracing.wrap(consumer) + def wrappedConsumer = telemetry.wrap(consumer) def records = wrappedConsumer.poll(Duration.ofSeconds(5).toMillis()) records.count() == 1 for (record in records) { diff --git a/instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/TracingHolder.java b/instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/TracingHolder.java index 09a69fae5061..e029936b7ab7 100644 --- a/instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/TracingHolder.java +++ b/instrumentation/lettuce/lettuce-5.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/lettuce/v5_1/TracingHolder.java @@ -7,12 +7,12 @@ import io.lettuce.core.tracing.Tracing; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.lettuce.v5_1.LettuceTracing; +import io.opentelemetry.instrumentation.lettuce.v5_1.LettuceTelemetry; public final class TracingHolder { public static final Tracing TRACING = - LettuceTracing.create(GlobalOpenTelemetry.get()).newTracing(); + LettuceTelemetry.create(GlobalOpenTelemetry.get()).newTracing(); private TracingHolder() {} } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTracing.java b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTelemetry.java similarity index 63% rename from instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTracing.java rename to instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTelemetry.java index ac8f4a1c6a7c..455ecfd8b7e4 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTracing.java +++ b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTelemetry.java @@ -9,17 +9,17 @@ import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.trace.Tracer; -/** Entrypoint for tracing Lettuce or clients. */ -public final class LettuceTracing { +/** Entrypoint for instrumenting Lettuce or clients. */ +public final class LettuceTelemetry { - /** Returns a new {@link LettuceTracing} configured with the given {@link OpenTelemetry}. */ - public static LettuceTracing create(OpenTelemetry openTelemetry) { - return new LettuceTracing(openTelemetry); + /** Returns a new {@link LettuceTelemetry} configured with the given {@link OpenTelemetry}. */ + public static LettuceTelemetry create(OpenTelemetry openTelemetry) { + return new LettuceTelemetry(openTelemetry); } private final Tracer tracer; - private LettuceTracing(OpenTelemetry openTelemetry) { + private LettuceTelemetry(OpenTelemetry openTelemetry) { tracer = openTelemetry.getTracer("io.opentelemetry.lettuce-5.1"); } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceAsyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceAsyncClientTest.groovy index 6d03c5f5241d..ce86466732b9 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceAsyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceAsyncClientTest.groovy @@ -14,7 +14,7 @@ class LettuceAsyncClientTest extends AbstractLettuceAsyncClientTest implements L RedisClient createClient(String uri) { return RedisClient.create( ClientResources.builder() - .tracing(LettuceTracing.create(getOpenTelemetry()).newTracing()) + .tracing(LettuceTelemetry.create(getOpenTelemetry()).newTracing()) .build(), uri) } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy index 021e4c859516..41a87db8086b 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceReactiveClientTest.groovy @@ -19,7 +19,7 @@ class LettuceReactiveClientTest extends AbstractLettuceReactiveClientTest implem RedisClient createClient(String uri) { return RedisClient.create( ClientResources.builder() - .tracing(LettuceTracing.create(getOpenTelemetry()).newTracing()) + .tracing(LettuceTelemetry.create(getOpenTelemetry()).newTracing()) .build(), uri) } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientAuthTest.groovy b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientAuthTest.groovy index 1d770b074e79..7cb208b5b2ff 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientAuthTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientAuthTest.groovy @@ -14,7 +14,7 @@ class LettuceSyncClientAuthTest extends AbstractLettuceSyncClientAuthTest implem RedisClient createClient(String uri) { return RedisClient.create( ClientResources.builder() - .tracing(LettuceTracing.create(getOpenTelemetry()).newTracing()) + .tracing(LettuceTelemetry.create(getOpenTelemetry()).newTracing()) .build(), uri) } diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientTest.groovy b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientTest.groovy index 79ddc5a95526..76c536376387 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientTest.groovy +++ b/instrumentation/lettuce/lettuce-5.1/library/src/test/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceSyncClientTest.groovy @@ -14,7 +14,7 @@ class LettuceSyncClientTest extends AbstractLettuceSyncClientTest implements Lib RedisClient createClient(String uri) { return RedisClient.create( ClientResources.builder() - .tracing(LettuceTracing.create(getOpenTelemetry()).newTracing()) + .tracing(LettuceTelemetry.create(getOpenTelemetry()).newTracing()) .build(), uri) } diff --git a/instrumentation/mongo/mongo-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_1/MongoInstrumentationSingletons.java b/instrumentation/mongo/mongo-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_1/MongoInstrumentationSingletons.java index 4299899a043e..d17068b3e954 100644 --- a/instrumentation/mongo/mongo-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_1/MongoInstrumentationSingletons.java +++ b/instrumentation/mongo/mongo-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_1/MongoInstrumentationSingletons.java @@ -7,12 +7,12 @@ import com.mongodb.event.CommandListener; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.mongo.v3_1.MongoTracing; +import io.opentelemetry.instrumentation.mongo.v3_1.MongoTelemetry; public final class MongoInstrumentationSingletons { public static final CommandListener LISTENER = - MongoTracing.create(GlobalOpenTelemetry.get()).newCommandListener(); + MongoTelemetry.create(GlobalOpenTelemetry.get()).newCommandListener(); private MongoInstrumentationSingletons() {} } diff --git a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracing.java b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetry.java similarity index 66% rename from instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracing.java rename to instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetry.java index 71991c9e4e4b..ad3085020968 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracing.java +++ b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetry.java @@ -12,21 +12,23 @@ // TODO this class is used for all Mongo versions. Extract to mongo-common module /** Entrypoint to OpenTelemetry instrumentation of the MongoDB client. */ -public final class MongoTracing { +public final class MongoTelemetry { - /** Returns a new {@link MongoTracing} configured with the given {@link OpenTelemetry}. */ - public static MongoTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link MongoTelemetry} configured with the given {@link OpenTelemetry}. */ + public static MongoTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link MongoTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static MongoTracingBuilder builder(OpenTelemetry openTelemetry) { - return new MongoTracingBuilder(openTelemetry); + /** + * Returns a new {@link MongoTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static MongoTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new MongoTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; - MongoTracing(OpenTelemetry openTelemetry, int maxNormalizedQueryLength) { + MongoTelemetry(OpenTelemetry openTelemetry, int maxNormalizedQueryLength) { this.instrumenter = MongoInstrumenterFactory.createInstrumenter(openTelemetry, maxNormalizedQueryLength); } diff --git a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracingBuilder.java b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetryBuilder.java similarity index 60% rename from instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracingBuilder.java rename to instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetryBuilder.java index f06ed9ecf9d4..c756af1a04a9 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTracingBuilder.java +++ b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoTelemetryBuilder.java @@ -7,8 +7,8 @@ import io.opentelemetry.api.OpenTelemetry; -/** A builder of {@link MongoTracing}. */ -public final class MongoTracingBuilder { +/** A builder of {@link MongoTelemetry}. */ +public final class MongoTelemetryBuilder { // Visible for testing static final int DEFAULT_MAX_NORMALIZED_QUERY_LENGTH = 32 * 1024; @@ -17,7 +17,7 @@ public final class MongoTracingBuilder { private int maxNormalizedQueryLength = DEFAULT_MAX_NORMALIZED_QUERY_LENGTH; - MongoTracingBuilder(OpenTelemetry openTelemetry) { + MongoTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -25,13 +25,15 @@ public final class MongoTracingBuilder { * Sets the max length of recorded queries after normalization. Defaults to {@value * DEFAULT_MAX_NORMALIZED_QUERY_LENGTH}. */ - public MongoTracingBuilder setMaxNormalizedQueryLength(int maxNormalizedQueryLength) { + public MongoTelemetryBuilder setMaxNormalizedQueryLength(int maxNormalizedQueryLength) { this.maxNormalizedQueryLength = maxNormalizedQueryLength; return this; } - /** Returns a new {@link MongoTracing} with the settings of this {@link MongoTracingBuilder}. */ - public MongoTracing build() { - return new MongoTracing(openTelemetry, maxNormalizedQueryLength); + /** + * Returns a new {@link MongoTelemetry} with the settings of this {@link MongoTelemetryBuilder}. + */ + public MongoTelemetry build() { + return new MongoTelemetry(openTelemetry, maxNormalizedQueryLength); } } diff --git a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoClientTest.groovy b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoClientTest.groovy index 48a5c607eb99..47799519ced4 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoClientTest.groovy +++ b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoClientTest.groovy @@ -11,6 +11,6 @@ import io.opentelemetry.instrumentation.test.LibraryTestTrait class MongoClientTest extends AbstractMongo31ClientTest implements LibraryTestTrait { @Override void configureMongoClientOptions(MongoClientOptions.Builder options) { - options.addCommandListener(MongoTracing.create(openTelemetry).newCommandListener()) + options.addCommandListener(MongoTelemetry.create(openTelemetry).newCommandListener()) } } diff --git a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.groovy b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.groovy index 4529826589fa..1eb8695692d2 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.groovy +++ b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoDbAttributesGetterTest.groovy @@ -11,7 +11,7 @@ import org.bson.BsonInt32 import org.bson.BsonString import spock.lang.Specification -import static io.opentelemetry.instrumentation.mongo.v3_1.MongoTracingBuilder.DEFAULT_MAX_NORMALIZED_QUERY_LENGTH +import static MongoTelemetryBuilder.DEFAULT_MAX_NORMALIZED_QUERY_LENGTH import static java.util.Arrays.asList class MongoDbAttributesGetterTest extends Specification { diff --git a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoSpanNameExtractorTest.groovy b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoSpanNameExtractorTest.groovy index 74074efa4295..06ffbb133e57 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoSpanNameExtractorTest.groovy +++ b/instrumentation/mongo/mongo-3.1/library/src/test/groovy/io/opentelemetry/instrumentation/mongo/v3_1/MongoSpanNameExtractorTest.groovy @@ -10,7 +10,7 @@ import org.bson.BsonDocument import org.bson.BsonInt32 import spock.lang.Specification -import static io.opentelemetry.instrumentation.mongo.v3_1.MongoTracingBuilder.DEFAULT_MAX_NORMALIZED_QUERY_LENGTH +import static MongoTelemetryBuilder.DEFAULT_MAX_NORMALIZED_QUERY_LENGTH class MongoSpanNameExtractorTest extends Specification { diff --git a/instrumentation/mongo/mongo-3.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoInstrumentationSingletons.java b/instrumentation/mongo/mongo-3.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoInstrumentationSingletons.java index b01c3fe330ba..7ed8dbed9893 100644 --- a/instrumentation/mongo/mongo-3.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoInstrumentationSingletons.java +++ b/instrumentation/mongo/mongo-3.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v3_7/MongoInstrumentationSingletons.java @@ -7,12 +7,12 @@ import com.mongodb.event.CommandListener; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.mongo.v3_1.MongoTracing; +import io.opentelemetry.instrumentation.mongo.v3_1.MongoTelemetry; public final class MongoInstrumentationSingletons { public static final CommandListener LISTENER = - MongoTracing.create(GlobalOpenTelemetry.get()).newCommandListener(); + MongoTelemetry.create(GlobalOpenTelemetry.get()).newCommandListener(); private MongoInstrumentationSingletons() {} } diff --git a/instrumentation/mongo/mongo-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoInstrumentationSingletons.java b/instrumentation/mongo/mongo-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoInstrumentationSingletons.java index 6e59cb7a2040..47195e2de124 100644 --- a/instrumentation/mongo/mongo-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoInstrumentationSingletons.java +++ b/instrumentation/mongo/mongo-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongo/v4_0/MongoInstrumentationSingletons.java @@ -7,12 +7,12 @@ import com.mongodb.event.CommandListener; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.mongo.v3_1.MongoTracing; +import io.opentelemetry.instrumentation.mongo.v3_1.MongoTelemetry; public final class MongoInstrumentationSingletons { public static final CommandListener LISTENER = - MongoTracing.create(GlobalOpenTelemetry.get()).newCommandListener(); + MongoTelemetry.create(GlobalOpenTelemetry.get()).newCommandListener(); private MongoInstrumentationSingletons() {} } diff --git a/instrumentation/mongo/mongo-async-3.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoInstrumentationSingletons.java b/instrumentation/mongo/mongo-async-3.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoInstrumentationSingletons.java index 2c8c3cc384dd..388d8d776f35 100644 --- a/instrumentation/mongo/mongo-async-3.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoInstrumentationSingletons.java +++ b/instrumentation/mongo/mongo-async-3.3/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/mongoasync/v3_3/MongoInstrumentationSingletons.java @@ -7,12 +7,12 @@ import com.mongodb.event.CommandListener; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.mongo.v3_1.MongoTracing; +import io.opentelemetry.instrumentation.mongo.v3_1.MongoTelemetry; public final class MongoInstrumentationSingletons { public static final CommandListener LISTENER = - MongoTracing.create(GlobalOpenTelemetry.get()).newCommandListener(); + MongoTelemetry.create(GlobalOpenTelemetry.get()).newCommandListener(); private MongoInstrumentationSingletons() {} } diff --git a/instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3Singletons.java b/instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3Singletons.java index 4636fb4cc8b4..77158b065170 100644 --- a/instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3Singletons.java +++ b/instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3Singletons.java @@ -7,7 +7,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.PeerServiceAttributesExtractor; -import io.opentelemetry.instrumentation.okhttp.v3_0.OkHttpTracing; +import io.opentelemetry.instrumentation.okhttp.v3_0.OkHttpTelemetry; import io.opentelemetry.instrumentation.okhttp.v3_0.internal.OkHttpNetAttributesGetter; import okhttp3.Interceptor; @@ -16,7 +16,7 @@ public final class OkHttp3Singletons { @SuppressWarnings("deprecation") // we're still using the interceptor on its own for now public static final Interceptor TRACING_INTERCEPTOR = - OkHttpTracing.builder(GlobalOpenTelemetry.get()) + OkHttpTelemetry.builder(GlobalOpenTelemetry.get()) .addAttributesExtractor( PeerServiceAttributesExtractor.create(new OkHttpNetAttributesGetter())) .build() diff --git a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracing.java b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetry.java similarity index 78% rename from instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracing.java rename to instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetry.java index 460861878702..7b9e99b3ba73 100644 --- a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracing.java +++ b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetry.java @@ -15,23 +15,25 @@ import okhttp3.Request; import okhttp3.Response; -/** Entrypoint for tracing OkHttp clients. */ -public final class OkHttpTracing { +/** Entrypoint for instrumenting OkHttp clients. */ +public final class OkHttpTelemetry { - /** Returns a new {@link OkHttpTracing} configured with the given {@link OpenTelemetry}. */ - public static OkHttpTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link OkHttpTelemetry} configured with the given {@link OpenTelemetry}. */ + public static OkHttpTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link OkHttpTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static OkHttpTracingBuilder builder(OpenTelemetry openTelemetry) { - return new OkHttpTracingBuilder(openTelemetry); + /** + * Returns a new {@link OkHttpTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static OkHttpTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new OkHttpTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; private final ContextPropagators propagators; - OkHttpTracing(Instrumenter instrumenter, ContextPropagators propagators) { + OkHttpTelemetry(Instrumenter instrumenter, ContextPropagators propagators) { this.instrumenter = instrumenter; this.propagators = propagators; } diff --git a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracingBuilder.java b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java similarity index 84% rename from instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracingBuilder.java rename to instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java index 2c571211df65..33f1980b6d8c 100644 --- a/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTracingBuilder.java +++ b/instrumentation/okhttp/okhttp-3.0/library/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttpTelemetryBuilder.java @@ -22,8 +22,8 @@ import okhttp3.Request; import okhttp3.Response; -/** A builder of {@link OkHttpTracing}. */ -public final class OkHttpTracingBuilder { +/** A builder of {@link OkHttpTelemetry}. */ +public final class OkHttpTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.okhttp-3.0"; private final OpenTelemetry openTelemetry; @@ -33,7 +33,7 @@ public final class OkHttpTracingBuilder { httpAttributesExtractorBuilder = HttpClientAttributesExtractor.builder(OkHttpAttributesGetter.INSTANCE); - OkHttpTracingBuilder(OpenTelemetry openTelemetry) { + OkHttpTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -41,7 +41,7 @@ public final class OkHttpTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public OkHttpTracingBuilder addAttributesExtractor( + public OkHttpTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -52,7 +52,7 @@ public OkHttpTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public OkHttpTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public OkHttpTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -62,13 +62,15 @@ public OkHttpTracingBuilder setCapturedRequestHeaders(List requestHeader * * @param responseHeaders A list of HTTP header names. */ - public OkHttpTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public OkHttpTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } - /** Returns a new {@link OkHttpTracing} with the settings of this {@link OkHttpTracingBuilder}. */ - public OkHttpTracing build() { + /** + * Returns a new {@link OkHttpTelemetry} with the settings of this {@link OkHttpTelemetryBuilder}. + */ + public OkHttpTelemetry build() { OkHttpAttributesGetter httpAttributesGetter = OkHttpAttributesGetter.INSTANCE; OkHttpNetAttributesGetter attributesGetter = new OkHttpNetAttributesGetter(); @@ -83,6 +85,6 @@ public OkHttpTracing build() { .addAttributesExtractors(additionalExtractors) .addRequestMetrics(HttpClientMetrics.get()) .newInstrumenter(alwaysClient()); - return new OkHttpTracing(instrumenter, openTelemetry.getPropagators()); + return new OkHttpTelemetry(instrumenter, openTelemetry.getPropagators()); } } diff --git a/instrumentation/okhttp/okhttp-3.0/library/src/test/groovy/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttp3Test.groovy b/instrumentation/okhttp/okhttp-3.0/library/src/test/groovy/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttp3Test.groovy index 783de6d3d1a5..8b1ea121200c 100644 --- a/instrumentation/okhttp/okhttp-3.0/library/src/test/groovy/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttp3Test.groovy +++ b/instrumentation/okhttp/okhttp-3.0/library/src/test/groovy/io/opentelemetry/instrumentation/okhttp/v3_0/OkHttp3Test.groovy @@ -14,6 +14,6 @@ class OkHttp3Test extends AbstractOkHttp3Test implements LibraryTestTrait { @Override Call.Factory createCallFactory(OkHttpClient.Builder clientBuilder) { - return OkHttpTracing.create(getOpenTelemetry()).newCallFactory(clientBuilder.build()) + return OkHttpTelemetry.create(getOpenTelemetry()).newCallFactory(clientBuilder.build()) } } diff --git a/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzInstrumentation.java b/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzInstrumentation.java index 1be2243d9462..800bf2832614 100644 --- a/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzInstrumentation.java +++ b/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzInstrumentation.java @@ -52,7 +52,7 @@ public static void addTracingInterceptor( if (callDepth.decrementAndGet() > 0) { return; } - QuartzSingletons.TRACING.configure(scheduler); + QuartzSingletons.TELEMETRY.configure(scheduler); } } } diff --git a/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzSingletons.java b/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzSingletons.java index 9632f0ada335..edeb75312a55 100644 --- a/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzSingletons.java +++ b/instrumentation/quartz-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/quartz/v2_0/QuartzSingletons.java @@ -6,11 +6,11 @@ package io.opentelemetry.javaagent.instrumentation.quartz.v2_0; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.quartz.v2_0.QuartzTracing; +import io.opentelemetry.instrumentation.quartz.v2_0.QuartzTelemetry; public final class QuartzSingletons { - public static final QuartzTracing TRACING = QuartzTracing.create(GlobalOpenTelemetry.get()); + public static final QuartzTelemetry TELEMETRY = QuartzTelemetry.create(GlobalOpenTelemetry.get()); private QuartzSingletons() {} } diff --git a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracing.java b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetry.java similarity index 75% rename from instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracing.java rename to instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetry.java index 1b29afb3bfae..27d61af155b9 100644 --- a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracing.java +++ b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetry.java @@ -13,20 +13,22 @@ import org.quartz.SchedulerException; import org.quartz.impl.matchers.EverythingMatcher; -/** Entrypoint for tracing execution of Quartz jobs. */ -public final class QuartzTracing { +/** Entrypoint for telemetry instrumentation of Quartz jobs. */ +public final class QuartzTelemetry { - /** Returns a new {@link QuartzTracing} configured with the given {@link OpenTelemetry}. */ - public static QuartzTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link QuartzTelemetry} configured with the given {@link OpenTelemetry}. */ + public static QuartzTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } - /** Returns a new {@link QuartzTracingBuilder} configured with the given {@link OpenTelemetry}. */ - public static QuartzTracingBuilder builder(OpenTelemetry openTelemetry) { - return new QuartzTracingBuilder(openTelemetry); + /** + * Returns a new {@link QuartzTelemetryBuilder} configured with the given {@link OpenTelemetry}. + */ + public static QuartzTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new QuartzTelemetryBuilder(openTelemetry); } - QuartzTracing(JobListener jobListener) { + QuartzTelemetry(JobListener jobListener) { this.jobListener = jobListener; } diff --git a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracingBuilder.java b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java similarity index 79% rename from instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracingBuilder.java rename to instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java index 73b4a63ba391..aa471f968737 100644 --- a/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTracingBuilder.java +++ b/instrumentation/quartz-2.0/library/src/main/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTelemetryBuilder.java @@ -14,8 +14,8 @@ import java.util.List; import org.quartz.JobExecutionContext; -/** A builder of {@link QuartzTracing}. */ -public final class QuartzTracingBuilder { +/** A builder of {@link QuartzTelemetry}. */ +public final class QuartzTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.quartz-2.0"; @@ -24,7 +24,7 @@ public final class QuartzTracingBuilder { private final List> additionalExtractors = new ArrayList<>(); - QuartzTracingBuilder(OpenTelemetry openTelemetry) { + QuartzTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -32,14 +32,16 @@ public final class QuartzTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. The {@link AttributesExtractor} will be executed after all default extractors. */ - public QuartzTracingBuilder addAttributeExtractor( + public QuartzTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; } - /** Returns a new {@link QuartzTracing} with the settings of this {@link QuartzTracingBuilder}. */ - public QuartzTracing build() { + /** + * Returns a new {@link QuartzTelemetry} with the settings of this {@link QuartzTelemetryBuilder}. + */ + public QuartzTelemetry build() { InstrumenterBuilder instrumenter = Instrumenter.builder(openTelemetry, INSTRUMENTATION_NAME, new QuartzSpanNameExtractor()); @@ -48,6 +50,6 @@ public QuartzTracing build() { CodeAttributesExtractor.create(new QuartzCodeAttributesGetter())); instrumenter.addAttributesExtractors(additionalExtractors); - return new QuartzTracing(new TracingJobListener(instrumenter.newInstrumenter())); + return new QuartzTelemetry(new TracingJobListener(instrumenter.newInstrumenter())); } } diff --git a/instrumentation/quartz-2.0/library/src/test/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTest.java b/instrumentation/quartz-2.0/library/src/test/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTest.java index ffa9b8b6e072..ac89a24c96cb 100644 --- a/instrumentation/quartz-2.0/library/src/test/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTest.java +++ b/instrumentation/quartz-2.0/library/src/test/java/io/opentelemetry/instrumentation/quartz/v2_0/QuartzTest.java @@ -16,7 +16,7 @@ class QuartzTest extends AbstractQuartzTest { @Override protected void configureScheduler(Scheduler scheduler) { - QuartzTracing.create(testing.getOpenTelemetry()).configure(scheduler); + QuartzTelemetry.create(testing.getOpenTelemetry()).configure(scheduler); } @Override diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracing.java b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetry.java similarity index 75% rename from instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracing.java rename to instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetry.java index 9f7f3f1ce2b9..35cca31fdeba 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracing.java +++ b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetry.java @@ -18,37 +18,37 @@ import ratpack.registry.RegistrySpec; /** - * Entrypoint for tracing Ratpack servers. To apply OpenTelemetry to a server, configure the {@link - * RegistrySpec} using {@link #configureServerRegistry(RegistrySpec)}. + * Entrypoint for instrumenting Ratpack servers. To apply OpenTelemetry to a server, configure the + * {@link RegistrySpec} using {@link #configureServerRegistry(RegistrySpec)}. * *
{@code
- * RatpackTracing tracing = RatpackTracing.create(OpenTelemetrySdk.builder()
+ * RatpackTelemetry telemetry = RatpackTelemetry.create(OpenTelemetrySdk.builder()
  *   ...
  *   .build());
  * RatpackServer.start(server -> {
- *   server.registryOf(tracing::configureServerRegistry);
+ *   server.registryOf(telemetry::configureServerRegistry);
  *   server.handlers(chain -> ...);
  * });
  * }
*/ -public final class RatpackTracing { +public final class RatpackTelemetry { - /** Returns a new {@link RatpackTracing} configured with the given {@link OpenTelemetry}. */ - public static RatpackTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link RatpackTelemetry} configured with the given {@link OpenTelemetry}. */ + public static RatpackTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link RatpackTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link RatpackTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ - public static RatpackTracingBuilder builder(OpenTelemetry openTelemetry) { - return new RatpackTracingBuilder(openTelemetry); + public static RatpackTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new RatpackTelemetryBuilder(openTelemetry); } private final OpenTelemetryServerHandler serverHandler; private final OpenTelemetryHttpClient httpClientInstrumenter; - RatpackTracing( + RatpackTelemetry( Instrumenter serverInstrumenter, Instrumenter clientInstrumenter) { serverHandler = new OpenTelemetryServerHandler(serverInstrumenter); diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracingBuilder.java b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java similarity index 86% rename from instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracingBuilder.java rename to instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java index 27cb43d6cd6c..b1f435a6336a 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTracingBuilder.java +++ b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/RatpackTelemetryBuilder.java @@ -26,8 +26,8 @@ import ratpack.http.client.HttpResponse; import ratpack.http.client.RequestSpec; -/** A builder for {@link RatpackTracing}. */ -public final class RatpackTracingBuilder { +/** A builder for {@link RatpackTelemetry}. */ +public final class RatpackTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.ratpack-1.4"; @@ -45,7 +45,7 @@ public final class RatpackTracingBuilder { private final List> additionalHttpClientExtractors = new ArrayList<>(); - RatpackTracingBuilder(OpenTelemetry openTelemetry) { + RatpackTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -53,13 +53,13 @@ public final class RatpackTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. The {@link AttributesExtractor} will be executed after all default extractors. */ - public RatpackTracingBuilder addAttributeExtractor( + public RatpackTelemetryBuilder addAttributeExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; } - public RatpackTracingBuilder addClientAttributeExtractor( + public RatpackTelemetryBuilder addClientAttributeExtractor( AttributesExtractor attributesExtractor) { additionalHttpClientExtractors.add(attributesExtractor); return this; @@ -70,7 +70,7 @@ public RatpackTracingBuilder addClientAttributeExtractor( * * @param requestHeaders A list of HTTP header names. */ - public RatpackTracingBuilder setCapturedServerRequestHeaders(List requestHeaders) { + public RatpackTelemetryBuilder setCapturedServerRequestHeaders(List requestHeaders) { httpServerAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -80,7 +80,7 @@ public RatpackTracingBuilder setCapturedServerRequestHeaders(List reques * * @param responseHeaders A list of HTTP header names. */ - public RatpackTracingBuilder setCapturedServerResponseHeaders(List responseHeaders) { + public RatpackTelemetryBuilder setCapturedServerResponseHeaders(List responseHeaders) { httpServerAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } @@ -90,7 +90,7 @@ public RatpackTracingBuilder setCapturedServerResponseHeaders(List respo * * @param requestHeaders A list of HTTP header names. */ - public RatpackTracingBuilder setCapturedClientRequestHeaders(List requestHeaders) { + public RatpackTelemetryBuilder setCapturedClientRequestHeaders(List requestHeaders) { httpClientAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -100,13 +100,13 @@ public RatpackTracingBuilder setCapturedClientRequestHeaders(List reques * * @param responseHeaders A list of HTTP header names. */ - public RatpackTracingBuilder setCapturedClientResponseHeaders(List responseHeaders) { + public RatpackTelemetryBuilder setCapturedClientResponseHeaders(List responseHeaders) { httpClientAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } - /** Returns a new {@link RatpackTracing} with the configuration of this builder. */ - public RatpackTracing build() { + /** Returns a new {@link RatpackTelemetry} with the configuration of this builder. */ + public RatpackTelemetry build() { RatpackNetAttributesGetter netAttributes = new RatpackNetAttributesGetter(); RatpackHttpAttributesGetter httpAttributes = RatpackHttpAttributesGetter.INSTANCE; @@ -120,7 +120,7 @@ public RatpackTracing build() { .addRequestMetrics(HttpServerMetrics.get()) .newServerInstrumenter(RatpackGetter.INSTANCE); - return new RatpackTracing(instrumenter, httpClientInstrumenter()); + return new RatpackTelemetry(instrumenter, httpClientInstrumenter()); } private Instrumenter httpClientInstrumenter() { diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/client/InstrumentedHttpClientTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/client/InstrumentedHttpClientTest.groovy index 1cda8adaf70d..8c4d74d1dbb0 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/client/InstrumentedHttpClientTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/client/InstrumentedHttpClientTest.groovy @@ -9,7 +9,7 @@ import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.StatusCode import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator import io.opentelemetry.context.propagation.ContextPropagators -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.sdk.OpenTelemetrySdk import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter import io.opentelemetry.sdk.trace.SdkTracerProvider @@ -42,7 +42,7 @@ class InstrumentedHttpClientTest extends Specification { .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) .setTracerProvider(tracerProvider).build() - RatpackTracing ratpackTracing = RatpackTracing.create(openTelemetry) + RatpackTelemetry telemetry = RatpackTelemetry.create(openTelemetry) def cleanup() { spanExporter.reset() @@ -53,7 +53,7 @@ class InstrumentedHttpClientTest extends Specification { def otherApp = EmbeddedApp.of { spec -> spec.registry( Guice.registry { bindings -> - ratpackTracing.configureServerRegistry(bindings) + telemetry.configureServerRegistry(bindings) } ) spec.handlers { @@ -64,8 +64,8 @@ class InstrumentedHttpClientTest extends Specification { def app = EmbeddedApp.of { spec -> spec.registry( Guice.registry { bindings -> - ratpackTracing.configureServerRegistry(bindings) - bindings.bindInstance(HttpClient, ratpackTracing.instrumentHttpClient(HttpClient.of(Action.noop()))) + telemetry.configureServerRegistry(bindings) + bindings.bindInstance(HttpClient, telemetry.instrumentHttpClient(HttpClient.of(Action.noop()))) } ) @@ -125,8 +125,8 @@ class InstrumentedHttpClientTest extends Specification { def app = EmbeddedApp.of { spec -> spec.registry( Guice.registry { bindings -> - ratpackTracing.configureServerRegistry(bindings) - bindings.bindInstance(HttpClient, ratpackTracing.instrumentHttpClient(HttpClient.of(Action.noop()))) + telemetry.configureServerRegistry(bindings) + bindings.bindInstance(HttpClient, telemetry.instrumentHttpClient(HttpClient.of(Action.noop()))) } ) @@ -190,8 +190,8 @@ class InstrumentedHttpClientTest extends Specification { def app = EmbeddedApp.of { spec -> spec.registry( Guice.registry { bindings -> - ratpackTracing.configureServerRegistry(bindings) - bindings.bindInstance(HttpClient, ratpackTracing.instrumentHttpClient( + telemetry.configureServerRegistry(bindings) + bindings.bindInstance(HttpClient, telemetry.instrumentHttpClient( HttpClient.of { s -> s.readTimeout(Duration.ofMillis(10)) }) ) } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackAsyncHttpServerTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackAsyncHttpServerTest.groovy index f5334cd4df97..259e4f828b40 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackAsyncHttpServerTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackAsyncHttpServerTest.groovy @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.ratpack.server -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint @@ -14,12 +14,12 @@ import ratpack.server.RatpackServerSpec class RatpackAsyncHttpServerTest extends AbstractRatpackAsyncHttpServerTest implements LibraryTestTrait { @Override void configure(RatpackServerSpec serverSpec) { - RatpackTracing tracing = RatpackTracing.builder(openTelemetry) + RatpackTelemetry telemetry = RatpackTelemetry.builder(openTelemetry) .setCapturedServerRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedServerResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() serverSpec.registryOf { - tracing.configureServerRegistry(it) + telemetry.configureServerRegistry(it) } } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackForkedHttpServerTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackForkedHttpServerTest.groovy index 040bc5305dc1..e1742b0ad32d 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackForkedHttpServerTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackForkedHttpServerTest.groovy @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.ratpack.server -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint @@ -14,12 +14,12 @@ import ratpack.server.RatpackServerSpec class RatpackForkedHttpServerTest extends AbstractRatpackForkedHttpServerTest implements LibraryTestTrait { @Override void configure(RatpackServerSpec serverSpec) { - RatpackTracing tracing = RatpackTracing.builder(openTelemetry) + RatpackTelemetry telemetry = RatpackTelemetry.builder(openTelemetry) .setCapturedServerRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedServerResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() serverSpec.registryOf { - tracing.configureServerRegistry(it) + telemetry.configureServerRegistry(it) } } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackHttpServerTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackHttpServerTest.groovy index 7d7e70dbecaf..8d360fc6fd5f 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackHttpServerTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackHttpServerTest.groovy @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.ratpack.server -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint @@ -14,12 +14,12 @@ import ratpack.server.RatpackServerSpec class RatpackHttpServerTest extends AbstractRatpackHttpServerTest implements LibraryTestTrait { @Override void configure(RatpackServerSpec serverSpec) { - RatpackTracing tracing = RatpackTracing.builder(openTelemetry) + RatpackTelemetry telemetry = RatpackTelemetry.builder(openTelemetry) .setCapturedServerRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedServerResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() serverSpec.registryOf { - tracing.configureServerRegistry(it) + telemetry.configureServerRegistry(it) } } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackRoutesTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackRoutesTest.groovy index c39ba8451176..0498f3bd2171 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackRoutesTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackRoutesTest.groovy @@ -6,16 +6,16 @@ package io.opentelemetry.instrumentation.ratpack.server -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import ratpack.server.RatpackServerSpec class RatpackRoutesTest extends AbstractRatpackRoutesTest implements LibraryTestTrait { @Override void configure(RatpackServerSpec serverSpec) { - RatpackTracing tracing = RatpackTracing.create(openTelemetry) + RatpackTelemetry telemetry = RatpackTelemetry.create(openTelemetry) serverSpec.registryOf { - tracing.configureServerRegistry(it) + telemetry.configureServerRegistry(it) } } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerApplicationTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerApplicationTest.groovy index 95222d77155a..f231af36421e 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerApplicationTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerApplicationTest.groovy @@ -12,7 +12,7 @@ import io.opentelemetry.api.OpenTelemetry import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.instrumentation.ratpack.OpenTelemetryServerHandler import io.opentelemetry.instrumentation.ratpack.RatpackFunctionalTest -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.sdk.OpenTelemetrySdk import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter import io.opentelemetry.sdk.trace.SdkTracerProvider @@ -98,19 +98,19 @@ class OpenTelemetryModule extends AbstractModule { @Singleton @Provides - RatpackTracing ratpackTracing(OpenTelemetry openTelemetry) { - return RatpackTracing.create(openTelemetry) + RatpackTelemetry ratpackTracing(OpenTelemetry openTelemetry) { + return RatpackTelemetry.create(openTelemetry) } @Singleton @Provides - OpenTelemetryServerHandler ratpackServerHandler(RatpackTracing ratpackTracing) { + OpenTelemetryServerHandler ratpackServerHandler(RatpackTelemetry ratpackTracing) { return ratpackTracing.getOpenTelemetryServerHandler() } @Singleton @Provides - ExecInterceptor ratpackExecInterceptor(RatpackTracing ratpackTracing) { + ExecInterceptor ratpackExecInterceptor(RatpackTelemetry ratpackTracing) { return ratpackTracing.getOpenTelemetryExecInterceptor() } @@ -125,13 +125,13 @@ class OpenTelemetryModule extends AbstractModule { @Singleton @Provides - HttpClient instrumentedHttpClient(RatpackTracing ratpackTracing) { + HttpClient instrumentedHttpClient(RatpackTelemetry ratpackTracing) { return ratpackTracing.instrumentHttpClient(HttpClient.of {}) } @Singleton @Provides - ExecInitializer ratpackExecInitializer(RatpackTracing ratpackTracing) { + ExecInitializer ratpackExecInitializer(RatpackTelemetry ratpackTracing) { return ratpackTracing.getOpenTelemetryExecInitializer() } } diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerTest.groovy b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerTest.groovy index f60dcb49349e..25325edaf9fa 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerTest.groovy +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/groovy/io/opentelemetry/instrumentation/ratpack/server/RatpackServerTest.groovy @@ -8,7 +8,7 @@ package io.opentelemetry.instrumentation.ratpack.server import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator import io.opentelemetry.context.propagation.ContextPropagators -import io.opentelemetry.instrumentation.ratpack.RatpackTracing +import io.opentelemetry.instrumentation.ratpack.RatpackTelemetry import io.opentelemetry.sdk.OpenTelemetrySdk import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter import io.opentelemetry.sdk.trace.SdkTracerProvider @@ -31,7 +31,7 @@ class RatpackServerTest extends Specification { .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) .setTracerProvider(tracerProvider).build() - def ratpackTracing = RatpackTracing.create(openTelemetry) + def telemetry = RatpackTelemetry.create(openTelemetry) def cleanup() { spanExporter.reset() @@ -40,7 +40,7 @@ class RatpackServerTest extends Specification { def "add span on handlers"() { given: def app = EmbeddedApp.of { spec -> - spec.registry { Registry.of { ratpackTracing.configureServerRegistry(it) } } + spec.registry { Registry.of { telemetry.configureServerRegistry(it) } } spec.handlers { chain -> chain.get("foo") { ctx -> ctx.render("hi-foo") } } @@ -65,7 +65,7 @@ class RatpackServerTest extends Specification { def "propagate trace with instrumented async operations"() { expect: def app = EmbeddedApp.of { spec -> - spec.registry { Registry.of { ratpackTracing.configureServerRegistry(it) } } + spec.registry { Registry.of { telemetry.configureServerRegistry(it) } } spec.handlers { chain -> chain.get("foo") { ctx -> ctx.render("hi-foo") @@ -104,7 +104,7 @@ class RatpackServerTest extends Specification { def "propagate trace with instrumented async concurrent operations"() { expect: def app = EmbeddedApp.of { spec -> - spec.registry { Registry.of { ratpackTracing.configureServerRegistry(it) } } + spec.registry { Registry.of { telemetry.configureServerRegistry(it) } } spec.handlers { chain -> chain.get("bar") { ctx -> ctx.render("hi-bar") diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/test/java/io/opentelemetry/instrumentation/ratpack/RatpackHttpClientTest.java b/instrumentation/ratpack/ratpack-1.7/library/src/test/java/io/opentelemetry/instrumentation/ratpack/RatpackHttpClientTest.java index a0ea3d12cade..eaf76446d6d2 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/test/java/io/opentelemetry/instrumentation/ratpack/RatpackHttpClientTest.java +++ b/instrumentation/ratpack/ratpack-1.7/library/src/test/java/io/opentelemetry/instrumentation/ratpack/RatpackHttpClientTest.java @@ -19,13 +19,13 @@ class RatpackHttpClientTest extends AbstractRatpackHttpClientTest { @Override protected HttpClient buildHttpClient() throws Exception { - return RatpackTracing.create(testing.getOpenTelemetry()) + return RatpackTelemetry.create(testing.getOpenTelemetry()) .instrumentHttpClient(HttpClient.of(Action.noop())); } @Override protected HttpClient buildHttpClient(Action action) throws Exception { - return RatpackTracing.create(testing.getOpenTelemetry()) + return RatpackTelemetry.create(testing.getOpenTelemetry()) .instrumentHttpClient(HttpClient.of(action)); } } diff --git a/instrumentation/restlet/restlet-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/restlet/v1_0/RestletSingletons.java b/instrumentation/restlet/restlet-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/restlet/v1_0/RestletSingletons.java index 4071624e619c..e254e2dfa2d2 100644 --- a/instrumentation/restlet/restlet-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/restlet/v1_0/RestletSingletons.java +++ b/instrumentation/restlet/restlet-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/restlet/v1_0/RestletSingletons.java @@ -8,7 +8,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpRouteGetter; -import io.opentelemetry.instrumentation.restlet.v1_0.RestletTracing; +import io.opentelemetry.instrumentation.restlet.v1_0.RestletTelemetry; import io.opentelemetry.javaagent.bootstrap.servlet.ServletContextPath; import org.restlet.data.Request; import org.restlet.data.Response; @@ -16,7 +16,7 @@ public final class RestletSingletons { private static final Instrumenter INSTRUMENTER = - RestletTracing.create(GlobalOpenTelemetry.get()).getServerInstrumenter(); + RestletTelemetry.create(GlobalOpenTelemetry.get()).getServerInstrumenter(); public static Instrumenter instrumenter() { return INSTRUMENTER; diff --git a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracing.java b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetry.java similarity index 61% rename from instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracing.java rename to instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetry.java index cd77d2105d22..7dbafd1eb1bb 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracing.java +++ b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetry.java @@ -11,24 +11,24 @@ import org.restlet.data.Request; import org.restlet.data.Response; -/** Entrypoint for tracing Restlet servers. */ -public final class RestletTracing { +/** Entrypoint for instrumenting Restlet servers. */ +public final class RestletTelemetry { - /** Returns a new {@link RestletTracing} configured with the given {@link OpenTelemetry}. */ - public static RestletTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link RestletTelemetry} configured with the given {@link OpenTelemetry}. */ + public static RestletTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link RestletTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link RestletTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ - public static RestletTracingBuilder builder(OpenTelemetry openTelemetry) { - return new RestletTracingBuilder(openTelemetry); + public static RestletTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new RestletTelemetryBuilder(openTelemetry); } private final Instrumenter serverInstrumenter; - RestletTracing(Instrumenter serverInstrumenter) { + RestletTelemetry(Instrumenter serverInstrumenter) { this.serverInstrumenter = serverInstrumenter; } diff --git a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracingBuilder.java b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java similarity index 84% rename from instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracingBuilder.java rename to instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java index 52fb38f2f106..f4d9fb03d8a5 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTracingBuilder.java +++ b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletTelemetryBuilder.java @@ -19,8 +19,8 @@ import org.restlet.data.Request; import org.restlet.data.Response; -/** A builder of {@link RestletTracing}. */ -public final class RestletTracingBuilder { +/** A builder of {@link RestletTelemetry}. */ +public final class RestletTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.restlet-1.0"; @@ -31,7 +31,7 @@ public final class RestletTracingBuilder { httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(RestletHttpAttributesGetter.INSTANCE); - RestletTracingBuilder(OpenTelemetry openTelemetry) { + RestletTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -39,7 +39,7 @@ public final class RestletTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public RestletTracingBuilder addAttributesExtractor( + public RestletTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -50,7 +50,7 @@ public RestletTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public RestletTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public RestletTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -60,15 +60,16 @@ public RestletTracingBuilder setCapturedRequestHeaders(List requestHeade * * @param responseHeaders A list of HTTP header names. */ - public RestletTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public RestletTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link RestletTracing} with the settings of this {@link RestletTracingBuilder}. + * Returns a new {@link RestletTelemetry} with the settings of this {@link + * RestletTelemetryBuilder}. */ - public RestletTracing build() { + public RestletTelemetry build() { RestletHttpAttributesGetter httpAttributesGetter = RestletHttpAttributesGetter.INSTANCE; RestletNetAttributesGetter netAttributesGetter = new RestletNetAttributesGetter(); @@ -84,6 +85,6 @@ public RestletTracing build() { .addRequestMetrics(HttpServerMetrics.get()) .newServerInstrumenter(RestletHeadersGetter.INSTANCE); - return new RestletTracing(instrumenter); + return new RestletTelemetry(instrumenter); } } diff --git a/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/RestletServerTest.groovy b/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/RestletServerTest.groovy index d49e4624fbaa..2e919ebed2f4 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/RestletServerTest.groovy +++ b/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/RestletServerTest.groovy @@ -7,7 +7,7 @@ package io.opententelemetry.instrumentation.restlet.v1_0 import com.noelios.restlet.StatusFilter import io.opentelemetry.instrumentation.restlet.v1_0.AbstractRestletServerTest -import io.opentelemetry.instrumentation.restlet.v1_0.RestletTracing +import io.opentelemetry.instrumentation.restlet.v1_0.RestletTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest import org.restlet.Restlet @@ -16,12 +16,12 @@ class RestletServerTest extends AbstractRestletServerTest implements LibraryTest @Override Restlet wrapRestlet(Restlet restlet, String path) { - RestletTracing tracing = RestletTracing.builder(openTelemetry) + RestletTelemetry telemetry = RestletTelemetry.builder(openTelemetry) .setCapturedRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() - def tracingFilter = tracing.newFilter(path) + def tracingFilter = telemetry.newFilter(path) def statusFilter = new StatusFilter(component.getContext(), false, null, null) tracingFilter.setNext(statusFilter) diff --git a/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/spring/AbstractSpringServerLibraryTest.groovy b/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/spring/AbstractSpringServerLibraryTest.groovy index 3470d5e6d0b5..681973629c6e 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/spring/AbstractSpringServerLibraryTest.groovy +++ b/instrumentation/restlet/restlet-1.0/library/src/test/groovy/io/opententelemetry/instrumentation/restlet/v1_0/spring/AbstractSpringServerLibraryTest.groovy @@ -6,7 +6,7 @@ package io.opententelemetry.instrumentation.restlet.v1_0.spring import com.noelios.restlet.StatusFilter -import io.opentelemetry.instrumentation.restlet.v1_0.RestletTracing +import io.opentelemetry.instrumentation.restlet.v1_0.RestletTelemetry import io.opentelemetry.instrumentation.restlet.v1_0.spring.AbstractSpringServerTest import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest @@ -18,13 +18,12 @@ import org.restlet.util.RouteList abstract class AbstractSpringServerLibraryTest extends AbstractSpringServerTest implements LibraryTestTrait { @Override Restlet wrapRestlet(Restlet restlet, String path) { - - RestletTracing tracing = RestletTracing.builder(openTelemetry) + RestletTelemetry telemetry = RestletTelemetry.builder(openTelemetry) .setCapturedRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() - def tracingFilter = tracing.newFilter(path) + def tracingFilter = telemetry.newFilter(path) def statusFilter = new StatusFilter(component.getContext(), false, null, null) tracingFilter.setNext(statusFilter) diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracing.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetry.java similarity index 57% rename from instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracing.java rename to instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetry.java index 2140efb4eb29..69e839757904 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracing.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetry.java @@ -11,24 +11,24 @@ import org.restlet.Response; import org.restlet.routing.Filter; -/** Entrypoint for tracing Restlet servers. */ -public final class RestletTracing { +/** Entrypoint for instrumenting Restlet servers. */ +public final class RestletTelemetry { - /** Returns a new {@link RestletTracing} configured with the given {@link OpenTelemetry}. */ - public static RestletTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link RestletTelemetry} configured with the given {@link OpenTelemetry}. */ + public static RestletTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link RestletTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link RestletTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ - public static RestletTracingBuilder builder(OpenTelemetry openTelemetry) { - return new RestletTracingBuilder(openTelemetry); + public static RestletTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new RestletTelemetryBuilder(openTelemetry); } private final Instrumenter serverInstrumenter; - RestletTracing(Instrumenter serverInstrumenter) { + RestletTelemetry(Instrumenter serverInstrumenter) { this.serverInstrumenter = serverInstrumenter; } diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracingBuilder.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetryBuilder.java similarity index 79% rename from instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracingBuilder.java rename to instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetryBuilder.java index 61345c2ca76a..a6bc1638b3f0 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTracingBuilder.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/RestletTelemetryBuilder.java @@ -17,8 +17,8 @@ import org.restlet.Request; import org.restlet.Response; -/** A builder of {@link RestletTracing}. */ -public final class RestletTracingBuilder { +/** A builder of {@link RestletTelemetry}. */ +public final class RestletTelemetryBuilder { private final OpenTelemetry openTelemetry; private final List> additionalExtractors = @@ -27,7 +27,7 @@ public final class RestletTracingBuilder { httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(RestletHttpAttributesGetter.INSTANCE); - RestletTracingBuilder(OpenTelemetry openTelemetry) { + RestletTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -35,7 +35,7 @@ public final class RestletTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public RestletTracingBuilder addAttributesExtractor( + public RestletTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -46,7 +46,7 @@ public RestletTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public RestletTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public RestletTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -56,19 +56,20 @@ public RestletTracingBuilder setCapturedRequestHeaders(List requestHeade * * @param responseHeaders A list of HTTP header names. */ - public RestletTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public RestletTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link RestletTracing} with the settings of this {@link RestletTracingBuilder}. + * Returns a new {@link RestletTelemetry} with the settings of this {@link + * RestletTelemetryBuilder}. */ - public RestletTracing build() { + public RestletTelemetry build() { Instrumenter serverInstrumenter = RestletInstrumenterFactory.newServerInstrumenter( openTelemetry, httpAttributesExtractorBuilder.build(), additionalExtractors); - return new RestletTracing(serverInstrumenter); + return new RestletTelemetry(serverInstrumenter); } } diff --git a/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/RestletServerTest.groovy b/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/RestletServerTest.groovy index 637d983b3b4b..757d600394bb 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/RestletServerTest.groovy +++ b/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/RestletServerTest.groovy @@ -15,13 +15,12 @@ class RestletServerTest extends AbstractRestletServerTest implements LibraryTest @Override Restlet wrapRestlet(Restlet restlet, String path) { - - RestletTracing tracing = RestletTracing.builder(openTelemetry) + RestletTelemetry telemetry = RestletTelemetry.builder(openTelemetry) .setCapturedRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() - def tracingFilter = tracing.newFilter(path) + def tracingFilter = telemetry.newFilter(path) def statusFilter = new StatusFilter(component.getContext(), new StatusService()) tracingFilter.setNext(statusFilter) diff --git a/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/spring/AbstractSpringServerLibraryTest.groovy b/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/spring/AbstractSpringServerLibraryTest.groovy index 054b7813a886..b6a80a7b065d 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/spring/AbstractSpringServerLibraryTest.groovy +++ b/instrumentation/restlet/restlet-2.0/library/src/test/groovy/io/opentelemetry/instrumentation/restlet/v2_0/spring/AbstractSpringServerLibraryTest.groovy @@ -5,7 +5,7 @@ package io.opentelemetry.instrumentation.restlet.v2_0.spring -import io.opentelemetry.instrumentation.restlet.v2_0.RestletTracing +import io.opentelemetry.instrumentation.restlet.v2_0.RestletTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest import org.restlet.Request @@ -24,13 +24,12 @@ import java.lang.reflect.Modifier abstract class AbstractSpringServerLibraryTest extends AbstractSpringServerTest implements LibraryTestTrait { @Override Restlet wrapRestlet(Restlet restlet, String path) { - - RestletTracing tracing = RestletTracing.builder(openTelemetry) + RestletTelemetry telemetry = RestletTelemetry.builder(openTelemetry) .setCapturedRequestHeaders([AbstractHttpServerTest.TEST_REQUEST_HEADER]) .setCapturedResponseHeaders([AbstractHttpServerTest.TEST_RESPONSE_HEADER]) .build() - def tracingFilter = tracing.newFilter(path) + def tracingFilter = telemetry.newFilter(path) def statusFilter = new StatusFilter(component.getContext(), new StatusService()) tracingFilter.setNext(statusFilter) diff --git a/instrumentation/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmq/RocketMqClientHooks.java b/instrumentation/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmq/RocketMqClientHooks.java index c8c34c0bdcb3..122ca1a722af 100644 --- a/instrumentation/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmq/RocketMqClientHooks.java +++ b/instrumentation/rocketmq-client-4.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmq/RocketMqClientHooks.java @@ -7,13 +7,13 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.rocketmq.RocketMqTracing; +import io.opentelemetry.instrumentation.rocketmq.RocketMqTelemetry; import org.apache.rocketmq.client.hook.ConsumeMessageHook; import org.apache.rocketmq.client.hook.SendMessageHook; public final class RocketMqClientHooks { - private static final RocketMqTracing TRACING = - RocketMqTracing.builder(GlobalOpenTelemetry.get()) + private static final RocketMqTelemetry TELEMETRY = + RocketMqTelemetry.builder(GlobalOpenTelemetry.get()) .setPropagationEnabled( Config.get().getBoolean("otel.instrumentation.rocketmq-client.propagation", true)) .setCaptureExperimentalSpanAttributes( @@ -23,7 +23,7 @@ public final class RocketMqClientHooks { .build(); public static final ConsumeMessageHook CONSUME_MESSAGE_HOOK = - TRACING.newTracingConsumeMessageHook(); + TELEMETRY.newTracingConsumeMessageHook(); - public static final SendMessageHook SEND_MESSAGE_HOOK = TRACING.newTracingSendMessageHook(); + public static final SendMessageHook SEND_MESSAGE_HOOK = TELEMETRY.newTracingSendMessageHook(); } diff --git a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracing.java b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetry.java similarity index 77% rename from instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracing.java rename to instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetry.java index 9d7737e45b99..7e474db50ce9 100644 --- a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracing.java +++ b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetry.java @@ -11,25 +11,25 @@ import org.apache.rocketmq.client.hook.SendMessageContext; import org.apache.rocketmq.client.hook.SendMessageHook; -/** Entrypoint for tracing RocketMq producers or consumers. */ -public final class RocketMqTracing { +/** Entrypoint for instrumenting RocketMq producers or consumers. */ +public final class RocketMqTelemetry { - /** Returns a new {@link RocketMqTracing} configured with the given {@link OpenTelemetry}. */ - public static RocketMqTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link RocketMqTelemetry} configured with the given {@link OpenTelemetry}. */ + public static RocketMqTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link RocketMqTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link RocketMqTelemetryBuilder} configured with the given {@link OpenTelemetry}. */ - public static RocketMqTracingBuilder builder(OpenTelemetry openTelemetry) { - return new RocketMqTracingBuilder(openTelemetry); + public static RocketMqTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new RocketMqTelemetryBuilder(openTelemetry); } private final RocketMqConsumerInstrumenter rocketMqConsumerInstrumenter; private final Instrumenter rocketMqProducerInstrumenter; - RocketMqTracing( + RocketMqTelemetry( OpenTelemetry openTelemetry, boolean captureExperimentalSpanAttributes, boolean propagationEnabled) { diff --git a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracingBuilder.java b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetryBuilder.java similarity index 69% rename from instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracingBuilder.java rename to instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetryBuilder.java index faaa2407d4b8..6056e728691f 100644 --- a/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTracingBuilder.java +++ b/instrumentation/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmq/RocketMqTelemetryBuilder.java @@ -7,15 +7,15 @@ import io.opentelemetry.api.OpenTelemetry; -/** A builder of {@link RocketMqTracing}. */ -public final class RocketMqTracingBuilder { +/** A builder of {@link RocketMqTelemetry}. */ +public final class RocketMqTelemetryBuilder { private final OpenTelemetry openTelemetry; private boolean captureExperimentalSpanAttributes; private boolean propagationEnabled = true; - RocketMqTracingBuilder(OpenTelemetry openTelemetry) { + RocketMqTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -24,7 +24,7 @@ public final class RocketMqTracingBuilder { * removed in the future, so only enable this if you know you do not require attributes filled by * this instrumentation to be stable across versions */ - public RocketMqTracingBuilder setCaptureExperimentalSpanAttributes( + public RocketMqTelemetryBuilder setCaptureExperimentalSpanAttributes( boolean captureExperimentalSpanAttributes) { this.captureExperimentalSpanAttributes = captureExperimentalSpanAttributes; return this; @@ -34,16 +34,17 @@ public RocketMqTracingBuilder setCaptureExperimentalSpanAttributes( * Sets whether the trace context should be written from producers / read from consumers for * propagating through messaging. */ - public RocketMqTracingBuilder setPropagationEnabled(boolean propagationEnabled) { + public RocketMqTelemetryBuilder setPropagationEnabled(boolean propagationEnabled) { this.propagationEnabled = propagationEnabled; return this; } /** - * Returns a new {@link RocketMqTracing} with the settings of this {@link RocketMqTracingBuilder}. + * Returns a new {@link RocketMqTelemetry} with the settings of this {@link + * RocketMqTelemetryBuilder}. */ - public RocketMqTracing build() { - return new RocketMqTracing( + public RocketMqTelemetry build() { + return new RocketMqTelemetry( openTelemetry, captureExperimentalSpanAttributes, propagationEnabled); } } diff --git a/instrumentation/rocketmq-client-4.8/library/src/test/groovy/io/opentelemetry/instrumentation/rocketmq/RocketMqClientTest.groovy b/instrumentation/rocketmq-client-4.8/library/src/test/groovy/io/opentelemetry/instrumentation/rocketmq/RocketMqClientTest.groovy index fb69283d237e..d6810f745dcf 100644 --- a/instrumentation/rocketmq-client-4.8/library/src/test/groovy/io/opentelemetry/instrumentation/rocketmq/RocketMqClientTest.groovy +++ b/instrumentation/rocketmq-client-4.8/library/src/test/groovy/io/opentelemetry/instrumentation/rocketmq/RocketMqClientTest.groovy @@ -14,7 +14,7 @@ class RocketMqClientTest extends AbstractRocketMqClientTest implements LibraryTe @Override void configureMQProducer(DefaultMQProducer producer) { - producer.getDefaultMQProducerImpl().registerSendMessageHook(RocketMqTracing.builder(openTelemetry) + producer.getDefaultMQProducerImpl().registerSendMessageHook(RocketMqTelemetry.builder(openTelemetry) .setCaptureExperimentalSpanAttributes( Config.get() .getBoolean( @@ -24,7 +24,7 @@ class RocketMqClientTest extends AbstractRocketMqClientTest implements LibraryTe @Override void configureMQPushConsumer(DefaultMQPushConsumer consumer) { - consumer.getDefaultMQPushConsumerImpl().registerConsumeMessageHook(RocketMqTracing.builder(openTelemetry) + consumer.getDefaultMQPushConsumerImpl().registerConsumeMessageHook(RocketMqTelemetry.builder(openTelemetry) .setCaptureExperimentalSpanAttributes( Config.get() .getBoolean( diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java index bc58ecc9d721..709c5e4200f1 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/resttemplate/RestTemplateBeanPostProcessor.java @@ -6,7 +6,7 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.httpclients.resttemplate; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.instrumentation.spring.web.SpringWebTracing; +import io.opentelemetry.instrumentation.spring.web.SpringWebTelemetry; import java.util.List; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.config.BeanPostProcessor; @@ -30,7 +30,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) { OpenTelemetry openTelemetry = openTelemetryProvider.getIfUnique(); if (openTelemetry != null) { ClientHttpRequestInterceptor interceptor = - SpringWebTracing.create(openTelemetry).newInterceptor(); + SpringWebTelemetry.create(openTelemetry).newInterceptor(); addRestTemplateInterceptorIfNotPresent(restTemplate, interceptor); } return restTemplate; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java index 1cbc613a34a4..e3e1cdda4929 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/httpclients/webclient/WebClientBeanPostProcessor.java @@ -6,7 +6,7 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.httpclients.webclient; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.instrumentation.spring.webflux.client.SpringWebfluxTracing; +import io.opentelemetry.instrumentation.spring.webflux.client.SpringWebfluxTelemetry; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.web.reactive.function.client.WebClient; @@ -41,7 +41,7 @@ private static WebClient.Builder wrapBuilder( OpenTelemetry openTelemetry = openTelemetryProvider.getIfUnique(); if (openTelemetry != null) { - SpringWebfluxTracing instrumentation = SpringWebfluxTracing.create(openTelemetry); + SpringWebfluxTelemetry instrumentation = SpringWebfluxTelemetry.create(openTelemetry); return webClientBuilder.filters(instrumentation::addClientTracingFilter); } else { return webClientBuilder; diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java index 6e6f97057a18..c73cdc2a7f6a 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/webmvc/WebMvcFilterAutoConfiguration.java @@ -6,7 +6,7 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.webmvc; import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.instrumentation.spring.webmvc.SpringWebMvcTracing; +import io.opentelemetry.instrumentation.spring.webmvc.SpringWebMvcTelemetry; import javax.servlet.Filter; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.filter.OncePerRequestFilter; -/** Configures {@link SpringWebMvcTracing} for tracing. */ +/** Configures {@link SpringWebMvcTelemetry} for tracing. */ @Configuration @EnableConfigurationProperties(WebMvcProperties.class) @ConditionalOnProperty(prefix = "otel.springboot.web", name = "enabled", matchIfMissing = true) @@ -24,6 +24,6 @@ public class WebMvcFilterAutoConfiguration { @Bean public Filter otelWebMvcTracingFilter(OpenTelemetry openTelemetry) { - return SpringWebMvcTracing.create(openTelemetry).newServletFilter(); + return SpringWebMvcTelemetry.create(openTelemetry).newServletFilter(); } } diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/integration/SpringIntegrationSingletons.java b/instrumentation/spring/spring-integration-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/integration/SpringIntegrationSingletons.java index b0aab16d8aaa..09b84082236a 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/integration/SpringIntegrationSingletons.java +++ b/instrumentation/spring/spring-integration-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/integration/SpringIntegrationSingletons.java @@ -9,7 +9,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.config.Config; -import io.opentelemetry.instrumentation.spring.integration.SpringIntegrationTracing; +import io.opentelemetry.instrumentation.spring.integration.SpringIntegrationTelemetry; import java.util.List; import org.springframework.messaging.support.ChannelInterceptor; @@ -22,7 +22,7 @@ public final class SpringIntegrationSingletons { singletonList("*")); private static final ChannelInterceptor INTERCEPTOR = - SpringIntegrationTracing.create(GlobalOpenTelemetry.get()).newChannelInterceptor(); + SpringIntegrationTelemetry.create(GlobalOpenTelemetry.get()).newChannelInterceptor(); public static String[] patterns() { return PATTERNS.toArray(new String[0]); diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTracingTest.groovy b/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTelemetryTest.groovy similarity index 65% rename from instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTracingTest.groovy rename to instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTelemetryTest.groovy index 24f69f2a8b27..9adea629a504 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTracingTest.groovy +++ b/instrumentation/spring/spring-integration-4.1/javaagent/src/test/groovy/SpringIntegrationTelemetryTest.groovy @@ -5,7 +5,7 @@ import io.opentelemetry.instrumentation.test.AgentTestTrait -class SpringIntegrationTracingTest extends AbstractSpringIntegrationTracingTest implements AgentTestTrait { +class SpringIntegrationTelemetryTest extends AbstractSpringIntegrationTracingTest implements AgentTestTrait { @Override Class additionalContextClass() { null diff --git a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracing.java b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetry.java similarity index 77% rename from instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracing.java rename to instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetry.java index c43abb44f61e..9ab97b2e2a32 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracing.java +++ b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetry.java @@ -13,28 +13,29 @@ import org.springframework.messaging.support.ChannelInterceptor; /** Entrypoint for instrumenting Spring Integration {@link MessageChannel}s. */ -public final class SpringIntegrationTracing { +public final class SpringIntegrationTelemetry { /** - * Returns a new {@link SpringIntegrationTracing} configured with the given {@link OpenTelemetry}. + * Returns a new {@link SpringIntegrationTelemetry} configured with the given {@link + * OpenTelemetry}. */ - public static SpringIntegrationTracing create(OpenTelemetry openTelemetry) { + public static SpringIntegrationTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link SpringIntegrationTracingBuilder} configured with the given {@link + * Returns a new {@link SpringIntegrationTelemetryBuilder} configured with the given {@link * OpenTelemetry}. */ - public static SpringIntegrationTracingBuilder builder(OpenTelemetry openTelemetry) { - return new SpringIntegrationTracingBuilder(openTelemetry); + public static SpringIntegrationTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new SpringIntegrationTelemetryBuilder(openTelemetry); } private final ContextPropagators propagators; private final Instrumenter consumerInstrumenter; private final Instrumenter producerInstrumenter; - SpringIntegrationTracing( + SpringIntegrationTelemetry( ContextPropagators propagators, Instrumenter consumerInstrumenter, Instrumenter producerInstrumenter) { diff --git a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracingBuilder.java b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java similarity index 81% rename from instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracingBuilder.java rename to instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java index 7c10e549220f..a15a84910b01 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTracingBuilder.java +++ b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/SpringIntegrationTelemetryBuilder.java @@ -14,15 +14,15 @@ import java.util.ArrayList; import java.util.List; -/** A builder of {@link SpringIntegrationTracing}. */ -public final class SpringIntegrationTracingBuilder { +/** A builder of {@link SpringIntegrationTelemetry}. */ +public final class SpringIntegrationTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-integration-4.1"; private final OpenTelemetry openTelemetry; private final List> additionalAttributeExtractors = new ArrayList<>(); - SpringIntegrationTracingBuilder(OpenTelemetry openTelemetry) { + SpringIntegrationTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -30,7 +30,7 @@ public final class SpringIntegrationTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public SpringIntegrationTracingBuilder addAttributesExtractor( + public SpringIntegrationTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalAttributeExtractors.add(attributesExtractor); return this; @@ -45,15 +45,15 @@ private static String producerSpanName(MessageWithChannel messageWithChannel) { } /** - * Returns a new {@link SpringIntegrationTracing} with the settings of this {@link - * SpringIntegrationTracingBuilder}. + * Returns a new {@link SpringIntegrationTelemetry} with the settings of this {@link + * SpringIntegrationTelemetryBuilder}. */ - public SpringIntegrationTracing build() { + public SpringIntegrationTelemetry build() { Instrumenter consumerInstrumenter = Instrumenter.builder( openTelemetry, INSTRUMENTATION_NAME, - SpringIntegrationTracingBuilder::consumerSpanName) + SpringIntegrationTelemetryBuilder::consumerSpanName) .addAttributesExtractors(additionalAttributeExtractors) .addAttributesExtractor( MessagingAttributesExtractor.create( @@ -64,13 +64,13 @@ public SpringIntegrationTracing build() { Instrumenter.builder( openTelemetry, INSTRUMENTATION_NAME, - SpringIntegrationTracingBuilder::producerSpanName) + SpringIntegrationTelemetryBuilder::producerSpanName) .addAttributesExtractors(additionalAttributeExtractors) .addAttributesExtractor( MessagingAttributesExtractor.create( SpringMessagingAttributesGetter.INSTANCE, MessageOperation.SEND)) .newInstrumenter(SpanKindExtractor.alwaysProducer()); - return new SpringIntegrationTracing( + return new SpringIntegrationTelemetry( openTelemetry.getPropagators(), consumerInstrumenter, producerInstrumenter); } } diff --git a/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/GlobalInterceptorSpringConfig.groovy b/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/GlobalInterceptorSpringConfig.groovy index 685cf3bd3dce..57e1e8dc9cbb 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/GlobalInterceptorSpringConfig.groovy +++ b/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/GlobalInterceptorSpringConfig.groovy @@ -4,7 +4,7 @@ */ import io.opentelemetry.api.GlobalOpenTelemetry -import io.opentelemetry.instrumentation.spring.integration.SpringIntegrationTracing +import io.opentelemetry.instrumentation.spring.integration.SpringIntegrationTelemetry import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.integration.config.GlobalChannelInterceptor @@ -16,6 +16,6 @@ class GlobalInterceptorSpringConfig { @GlobalChannelInterceptor @Bean ChannelInterceptor otelInterceptor() { - SpringIntegrationTracing.create(GlobalOpenTelemetry.get()).newChannelInterceptor() + SpringIntegrationTelemetry.create(GlobalOpenTelemetry.get()).newChannelInterceptor() } } diff --git a/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTracingTest.groovy b/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTelemetryTest.groovy similarity index 68% rename from instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTracingTest.groovy rename to instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTelemetryTest.groovy index 67c42521dded..b81fbcf40231 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTracingTest.groovy +++ b/instrumentation/spring/spring-integration-4.1/library/src/test/groovy/SpringIntegrationTelemetryTest.groovy @@ -5,7 +5,7 @@ import io.opentelemetry.instrumentation.test.LibraryTestTrait -class SpringIntegrationTracingTest extends AbstractSpringIntegrationTracingTest implements LibraryTestTrait { +class SpringIntegrationTelemetryTest extends AbstractSpringIntegrationTracingTest implements LibraryTestTrait { @Override Class additionalContextClass() { GlobalInterceptorSpringConfig diff --git a/instrumentation/spring/spring-web-3.1/library/README.md b/instrumentation/spring/spring-web-3.1/library/README.md index dbab153bbe2f..4c047ccdfc48 100644 --- a/instrumentation/spring/spring-web-3.1/library/README.md +++ b/instrumentation/spring/spring-web-3.1/library/README.md @@ -57,7 +57,7 @@ implementation("org.springframework:spring-web:SPRING_VERSION") #### Telemetry-producing `ClientHttpRequestInterceptor` implementation -`SpringWebTracing` allows creating a +`SpringWebTelemetry` allows creating a custom [ClientHttpRequestInterceptor](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/ClientHttpRequestInterceptor.html) that produces telemetry for HTTP requests sent using a `RestTemplate`. Example: @@ -65,7 +65,7 @@ that produces telemetry for HTTP requests sent using a `RestTemplate`. Example: ```java -import io.opentelemetry.instrumentation.spring.web.SpringWebTracing; +import io.opentelemetry.instrumentation.spring.web.SpringWebTelemetry; import io.opentelemetry.api.OpenTelemetry; import org.springframework.beans.factory.annotation.Autowired; @@ -81,8 +81,8 @@ public class RestTemplateConfig { public RestTemplate restTemplate(OpenTelemetry openTelemetry) { RestTemplate restTemplate = new RestTemplate(); - SpringWebTracing springWebTracing = SpringWebTracing.create(openTelemetry); - restTemplate.getInterceptors().add(springWebTracing.newInterceptor()); + SpringWebTelemetry telemetry = SpringWebTelemetry.create(openTelemetry); + restTemplate.getInterceptors().add(telemetry.newInterceptor()); return restTemplate; } diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracing.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetry.java similarity index 62% rename from instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracing.java rename to instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetry.java index 50a38c062650..4d2c1f9240ad 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracing.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetry.java @@ -12,24 +12,25 @@ import org.springframework.http.client.ClientHttpResponse; import org.springframework.web.client.RestTemplate; -/** Entrypoint for tracing Spring {@link org.springframework.web.client.RestTemplate}. */ -public final class SpringWebTracing { +/** Entrypoint for instrumenting Spring {@link org.springframework.web.client.RestTemplate}. */ +public final class SpringWebTelemetry { - /** Returns a new {@link SpringWebTracing} configured with the given {@link OpenTelemetry}. */ - public static SpringWebTracing create(OpenTelemetry openTelemetry) { + /** Returns a new {@link SpringWebTelemetry} configured with the given {@link OpenTelemetry}. */ + public static SpringWebTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link SpringWebTracingBuilder} configured with the given {@link OpenTelemetry}. + * Returns a new {@link SpringWebTelemetryBuilder} configured with the given {@link + * OpenTelemetry}. */ - public static SpringWebTracingBuilder builder(OpenTelemetry openTelemetry) { - return new SpringWebTracingBuilder(openTelemetry); + public static SpringWebTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new SpringWebTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; - SpringWebTracing(Instrumenter instrumenter) { + SpringWebTelemetry(Instrumenter instrumenter) { this.instrumenter = instrumenter; } diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java similarity index 84% rename from instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java rename to instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java index 33d88a02f723..f3e0fccda0fe 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryBuilder.java @@ -19,8 +19,8 @@ import org.springframework.http.HttpRequest; import org.springframework.http.client.ClientHttpResponse; -/** A builder of {@link SpringWebTracing}. */ -public final class SpringWebTracingBuilder { +/** A builder of {@link SpringWebTelemetry}. */ +public final class SpringWebTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-web-3.1"; private final OpenTelemetry openTelemetry; @@ -30,7 +30,7 @@ public final class SpringWebTracingBuilder { httpAttributesExtractorBuilder = HttpClientAttributesExtractor.builder(SpringWebHttpAttributesGetter.INSTANCE); - SpringWebTracingBuilder(OpenTelemetry openTelemetry) { + SpringWebTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -38,7 +38,7 @@ public final class SpringWebTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public SpringWebTracingBuilder addAttributesExtractor( + public SpringWebTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -49,7 +49,7 @@ public SpringWebTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public SpringWebTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public SpringWebTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -59,16 +59,16 @@ public SpringWebTracingBuilder setCapturedRequestHeaders(List requestHea * * @param responseHeaders A list of HTTP header names. */ - public SpringWebTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public SpringWebTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link SpringWebTracing} with the settings of this {@link - * SpringWebTracingBuilder}. + * Returns a new {@link SpringWebTelemetry} with the settings of this {@link + * SpringWebTelemetryBuilder}. */ - public SpringWebTracing build() { + public SpringWebTelemetry build() { SpringWebHttpAttributesGetter httpAttributeGetter = SpringWebHttpAttributesGetter.INSTANCE; SpringWebNetAttributesGetter netAttributesGetter = new SpringWebNetAttributesGetter(); @@ -84,6 +84,6 @@ public SpringWebTracing build() { .addRequestMetrics(HttpClientMetrics.get()) .newClientInstrumenter(HttpRequestSetter.INSTANCE); - return new SpringWebTracing(instrumenter); + return new SpringWebTelemetry(instrumenter); } } diff --git a/instrumentation/spring/spring-web-3.1/library/src/test/groovy/SpringWebInstrumentationTest.groovy b/instrumentation/spring/spring-web-3.1/library/src/test/groovy/SpringWebInstrumentationTest.groovy index 4c4f10f4420e..ec7873ea6e28 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/test/groovy/SpringWebInstrumentationTest.groovy +++ b/instrumentation/spring/spring-web-3.1/library/src/test/groovy/SpringWebInstrumentationTest.groovy @@ -4,7 +4,7 @@ */ import io.opentelemetry.api.common.AttributeKey -import io.opentelemetry.instrumentation.spring.web.SpringWebTracing +import io.opentelemetry.instrumentation.spring.web.SpringWebTelemetry import io.opentelemetry.instrumentation.test.LibraryTestTrait import io.opentelemetry.instrumentation.test.base.HttpClientTest import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpClientTest @@ -23,7 +23,7 @@ class SpringWebInstrumentationTest extends HttpClientTest> im def setupSpec() { if (restTemplate == null) { restTemplate = new RestTemplate() - restTemplate.getInterceptors().add(SpringWebTracing.create(getOpenTelemetry()).newInterceptor()) + restTemplate.getInterceptors().add(SpringWebTelemetry.create(getOpenTelemetry()).newInterceptor()) } } diff --git a/instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingTest.java b/instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryTest.java similarity index 93% rename from instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingTest.java rename to instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryTest.java index 662f36e9276d..3d75c32c3525 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingTest.java +++ b/instrumentation/spring/spring-web-3.1/library/src/test/java/io/opentelemetry/instrumentation/spring/web/SpringWebTelemetryTest.java @@ -20,7 +20,7 @@ import org.springframework.http.client.ClientHttpRequestInterceptor; @ExtendWith(MockitoExtension.class) -class SpringWebTracingTest { +class SpringWebTelemetryTest { @RegisterExtension static final LibraryInstrumentationExtension testing = LibraryInstrumentationExtension.create(); @@ -32,7 +32,7 @@ class SpringWebTracingTest { void shouldSkipWhenContextHasClientSpan() throws Exception { // given ClientHttpRequestInterceptor interceptor = - SpringWebTracing.create(testing.getOpenTelemetry()).newInterceptor(); + SpringWebTelemetry.create(testing.getOpenTelemetry()).newInterceptor(); // when testing.runWithClientSpan( diff --git a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/client/WebClientHelper.java b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/client/WebClientHelper.java index 6f51bddbd290..8aa9efe1173d 100644 --- a/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/client/WebClientHelper.java +++ b/instrumentation/spring/spring-webflux-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/client/WebClientHelper.java @@ -6,14 +6,14 @@ package io.opentelemetry.javaagent.instrumentation.spring.webflux.client; import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.spring.webflux.client.SpringWebfluxTracing; +import io.opentelemetry.instrumentation.spring.webflux.client.SpringWebfluxTelemetry; import java.util.List; import org.springframework.web.reactive.function.client.ExchangeFilterFunction; public class WebClientHelper { - private static final SpringWebfluxTracing INSTRUMENTATION = - SpringWebfluxTracing.create(GlobalOpenTelemetry.get()); + private static final SpringWebfluxTelemetry INSTRUMENTATION = + SpringWebfluxTelemetry.create(GlobalOpenTelemetry.get()); public static void addFilter(List exchangeFilterFunctions) { INSTRUMENTATION.addClientTracingFilter(exchangeFilterFunctions); diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracing.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetry.java similarity index 70% rename from instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracing.java rename to instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetry.java index 9be7f9ecb587..a330bc4449af 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracing.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetry.java @@ -13,26 +13,28 @@ import org.springframework.web.reactive.function.client.ClientResponse; import org.springframework.web.reactive.function.client.ExchangeFilterFunction; -/** Entrypoint for tracing Spring Webflux HTTP clients. */ -public final class SpringWebfluxTracing { +/** Entrypoint for instrumenting Spring Webflux HTTP clients. */ +public final class SpringWebfluxTelemetry { - /** Returns a new {@link SpringWebfluxTracing} configured with the given {@link OpenTelemetry}. */ - public static SpringWebfluxTracing create(OpenTelemetry openTelemetry) { + /** + * Returns a new {@link SpringWebfluxTelemetry} configured with the given {@link OpenTelemetry}. + */ + public static SpringWebfluxTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link SpringWebfluxTracingBuilder} configured with the given {@link + * Returns a new {@link SpringWebfluxTelemetryBuilder} configured with the given {@link * OpenTelemetry}. */ - public static SpringWebfluxTracingBuilder builder(OpenTelemetry openTelemetry) { - return new SpringWebfluxTracingBuilder(openTelemetry); + public static SpringWebfluxTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new SpringWebfluxTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; private final ContextPropagators propagators; - SpringWebfluxTracing( + SpringWebfluxTelemetry( Instrumenter instrumenter, ContextPropagators propagators) { this.instrumenter = instrumenter; this.propagators = propagators; diff --git a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracingBuilder.java b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java similarity index 85% rename from instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracingBuilder.java rename to instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java index ab6e3be68a1b..b57b7f168511 100644 --- a/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTracingBuilder.java +++ b/instrumentation/spring/spring-webflux-5.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webflux/client/SpringWebfluxTelemetryBuilder.java @@ -23,8 +23,8 @@ import org.springframework.web.reactive.function.client.ClientRequest; import org.springframework.web.reactive.function.client.ClientResponse; -/** A builder of {@link SpringWebfluxTracing}. */ -public final class SpringWebfluxTracingBuilder { +/** A builder of {@link SpringWebfluxTelemetry}. */ +public final class SpringWebfluxTelemetryBuilder { private final OpenTelemetry openTelemetry; private final List> additionalExtractors = @@ -33,7 +33,7 @@ public final class SpringWebfluxTracingBuilder { httpAttributesExtractorBuilder = HttpClientAttributesExtractor.builder(SpringWebfluxHttpAttributesGetter.INSTANCE); - SpringWebfluxTracingBuilder(OpenTelemetry openTelemetry) { + SpringWebfluxTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -41,7 +41,7 @@ public final class SpringWebfluxTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public SpringWebfluxTracingBuilder addAttributesExtractor( + public SpringWebfluxTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -52,7 +52,7 @@ public SpringWebfluxTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public SpringWebfluxTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public SpringWebfluxTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -62,16 +62,16 @@ public SpringWebfluxTracingBuilder setCapturedRequestHeaders(List reques * * @param responseHeaders A list of HTTP header names. */ - public SpringWebfluxTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public SpringWebfluxTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link SpringWebfluxTracing} with the settings of this {@link - * SpringWebfluxTracingBuilder}. + * Returns a new {@link SpringWebfluxTelemetry} with the settings of this {@link + * SpringWebfluxTelemetryBuilder}. */ - public SpringWebfluxTracing build() { + public SpringWebfluxTelemetry build() { SpringWebfluxHttpAttributesGetter httpAttributesGetter = SpringWebfluxHttpAttributesGetter.INSTANCE; SpringWebfluxNetAttributesGetter attributesGetter = new SpringWebfluxNetAttributesGetter(); @@ -98,6 +98,6 @@ public SpringWebfluxTracing build() { Instrumenter instrumenter = builder.newInstrumenter(alwaysClient()); - return new SpringWebfluxTracing(instrumenter, openTelemetry.getPropagators()); + return new SpringWebfluxTelemetry(instrumenter, openTelemetry.getPropagators()); } } diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracing.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetry.java similarity index 55% rename from instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracing.java rename to instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetry.java index e49bd256ab0e..161eb7444bb7 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracing.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetry.java @@ -11,25 +11,27 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -/** Entrypoint for tracing Spring Web MVC apps. */ -public final class SpringWebMvcTracing { +/** Entrypoint for instrumenting Spring Web MVC apps. */ +public final class SpringWebMvcTelemetry { - /** Returns a new {@link SpringWebMvcTracing} configured with the given {@link OpenTelemetry}. */ - public static SpringWebMvcTracing create(OpenTelemetry openTelemetry) { + /** + * Returns a new {@link SpringWebMvcTelemetry} configured with the given {@link OpenTelemetry}. + */ + public static SpringWebMvcTelemetry create(OpenTelemetry openTelemetry) { return builder(openTelemetry).build(); } /** - * Returns a new {@link SpringWebMvcTracingBuilder} configured with the given {@link + * Returns a new {@link SpringWebMvcTelemetryBuilder} configured with the given {@link * OpenTelemetry}. */ - public static SpringWebMvcTracingBuilder builder(OpenTelemetry openTelemetry) { - return new SpringWebMvcTracingBuilder(openTelemetry); + public static SpringWebMvcTelemetryBuilder builder(OpenTelemetry openTelemetry) { + return new SpringWebMvcTelemetryBuilder(openTelemetry); } private final Instrumenter instrumenter; - SpringWebMvcTracing(Instrumenter instrumenter) { + SpringWebMvcTelemetry(Instrumenter instrumenter) { this.instrumenter = instrumenter; } diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracingBuilder.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java similarity index 84% rename from instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracingBuilder.java rename to instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java index 6ae8780d7283..fc24447d3b5f 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTracingBuilder.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcTelemetryBuilder.java @@ -20,8 +20,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -/** A builder of {@link SpringWebMvcTracing}. */ -public final class SpringWebMvcTracingBuilder { +/** A builder of {@link SpringWebMvcTelemetry}. */ +public final class SpringWebMvcTelemetryBuilder { private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-webmvc-3.1"; @@ -32,7 +32,7 @@ public final class SpringWebMvcTracingBuilder { httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(SpringWebMvcHttpAttributesGetter.INSTANCE); - SpringWebMvcTracingBuilder(OpenTelemetry openTelemetry) { + SpringWebMvcTelemetryBuilder(OpenTelemetry openTelemetry) { this.openTelemetry = openTelemetry; } @@ -40,7 +40,7 @@ public final class SpringWebMvcTracingBuilder { * Adds an additional {@link AttributesExtractor} to invoke to set attributes to instrumented * items. */ - public SpringWebMvcTracingBuilder addAttributesExtractor( + public SpringWebMvcTelemetryBuilder addAttributesExtractor( AttributesExtractor attributesExtractor) { additionalExtractors.add(attributesExtractor); return this; @@ -51,7 +51,7 @@ public SpringWebMvcTracingBuilder addAttributesExtractor( * * @param requestHeaders A list of HTTP header names. */ - public SpringWebMvcTracingBuilder setCapturedRequestHeaders(List requestHeaders) { + public SpringWebMvcTelemetryBuilder setCapturedRequestHeaders(List requestHeaders) { httpAttributesExtractorBuilder.setCapturedRequestHeaders(requestHeaders); return this; } @@ -61,16 +61,16 @@ public SpringWebMvcTracingBuilder setCapturedRequestHeaders(List request * * @param responseHeaders A list of HTTP header names. */ - public SpringWebMvcTracingBuilder setCapturedResponseHeaders(List responseHeaders) { + public SpringWebMvcTelemetryBuilder setCapturedResponseHeaders(List responseHeaders) { httpAttributesExtractorBuilder.setCapturedResponseHeaders(responseHeaders); return this; } /** - * Returns a new {@link SpringWebMvcTracing} with the settings of this {@link - * SpringWebMvcTracingBuilder}. + * Returns a new {@link SpringWebMvcTelemetry} with the settings of this {@link + * SpringWebMvcTelemetryBuilder}. */ - public SpringWebMvcTracing build() { + public SpringWebMvcTelemetry build() { SpringWebMvcHttpAttributesGetter httpAttributesGetter = SpringWebMvcHttpAttributesGetter.INSTANCE; @@ -89,6 +89,6 @@ public SpringWebMvcTracing build() { .addContextCustomizer(HttpRouteHolder.get()) .newServerInstrumenter(JavaxHttpServletRequestGetter.INSTANCE); - return new SpringWebMvcTracing(instrumenter); + return new SpringWebMvcTelemetry(instrumenter); } }