diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractor.java index 6f50ea2a52b0..1a6b016d2ac3 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractor.java @@ -22,7 +22,7 @@ public final class CodeAttributesExtractor implements AttributesExtractor { /** Creates the code attributes extractor. */ - public static CodeAttributesExtractor create( + public static AttributesExtractor create( CodeAttributesGetter getter) { return new CodeAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractor.java index 564043e68ad7..3b1174185909 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractor.java @@ -9,6 +9,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; /** @@ -24,7 +25,7 @@ public final class DbClientAttributesExtractor REQUEST, RESPONSE, DbClientAttributesGetter> { /** Creates the database client attributes extractor with default configuration. */ - public static DbClientAttributesExtractor create( + public static AttributesExtractor create( DbClientAttributesGetter getter) { return new DbClientAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractor.java index de7a10d0ba23..00e7ba7533ed 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractor.java @@ -12,6 +12,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.db.SqlStatementInfo; import io.opentelemetry.instrumentation.api.db.SqlStatementSanitizer; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; /** @@ -29,7 +30,7 @@ public final class SqlClientAttributesExtractor REQUEST, RESPONSE, SqlClientAttributesGetter> { /** Creates the SQL client attributes extractor with default configuration. */ - public static SqlClientAttributesExtractor create( + public static AttributesExtractor create( SqlClientAttributesGetter getter) { return SqlClientAttributesExtractor.builder(getter).build(); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorBuilder.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorBuilder.java index 1d0793911cc5..641eb42aac7c 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorBuilder.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorBuilder.java @@ -10,6 +10,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.instrumentation.api.db.SqlStatementSanitizer; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; /** A builder of {@link SqlClientAttributesExtractor}. */ @@ -54,7 +55,7 @@ public SqlClientAttributesExtractorBuilder setStatementSaniti * Returns a new {@link SqlClientAttributesExtractor} with the settings of this {@link * SqlClientAttributesExtractorBuilder}. */ - public SqlClientAttributesExtractor build() { + public AttributesExtractor build() { return new SqlClientAttributesExtractor<>( getter, dbTableAttribute, SqlStatementSanitizer.create(statementSanitizationEnabled)); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java index eba10563b94f..026d0207f8a6 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractor.java @@ -9,6 +9,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.net.internal.InternalNetClientAttributesExtractor; import io.opentelemetry.instrumentation.api.internal.SpanKey; @@ -37,13 +38,13 @@ public final class HttpClientAttributesExtractor * @deprecated Use {@link #create(HttpClientAttributesGetter, NetClientAttributesGetter)} instead. */ @Deprecated - public static HttpClientAttributesExtractor create( + public static AttributesExtractor create( HttpClientAttributesGetter getter) { return builder(getter).build(); } /** Creates the HTTP client attributes extractor with default configuration. */ - public static HttpClientAttributesExtractor create( + public static AttributesExtractor create( HttpClientAttributesGetter httpAttributesGetter, NetClientAttributesGetter netAttributesGetter) { return builder(httpAttributesGetter, netAttributesGetter).build(); diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorBuilder.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorBuilder.java index 367fc1fd682d..a1cddcfa0e14 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorBuilder.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorBuilder.java @@ -8,6 +8,7 @@ import static java.util.Collections.emptyList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.util.List; @@ -67,7 +68,7 @@ public HttpClientAttributesExtractorBuilder setCapturedRespon * Returns a new {@link HttpClientAttributesExtractor} with the settings of this {@link * HttpClientAttributesExtractorBuilder}. */ - public HttpClientAttributesExtractor build() { + public AttributesExtractor build() { return new HttpClientAttributesExtractor<>( httpAttributesGetter, netAttributesGetter, capturedRequestHeaders, capturedResponseHeaders); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractor.java index 430d010b1949..f15ceb3babc2 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractor.java @@ -13,6 +13,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.net.internal.InternalNetServerAttributesExtractor; import io.opentelemetry.instrumentation.api.internal.SpanKey; @@ -37,7 +38,7 @@ public final class HttpServerAttributesExtractor implements SpanKeyProvider { /** Creates the HTTP server attributes extractor with default configuration. */ - public static HttpServerAttributesExtractor create( + public static AttributesExtractor create( HttpServerAttributesGetter httpAttributesGetter, NetServerAttributesGetter netAttributesGetter) { return builder(httpAttributesGetter, netAttributesGetter).build(); diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorBuilder.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorBuilder.java index 12e7bc5b3368..8e9d85366133 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorBuilder.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorBuilder.java @@ -8,6 +8,7 @@ import static java.util.Collections.emptyList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter; import java.util.List; @@ -67,7 +68,7 @@ public HttpServerAttributesExtractorBuilder setCapturedRespon * Returns a new {@link HttpServerAttributesExtractor} with the settings of this {@link * HttpServerAttributesExtractorBuilder}. */ - public HttpServerAttributesExtractor build() { + public AttributesExtractor build() { return new HttpServerAttributesExtractor<>( httpAttributesGetter, netAttributesGetter, capturedRequestHeaders, capturedResponseHeaders); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java index 2f4a9eb238b3..c47c21f1e3a3 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractor.java @@ -37,7 +37,7 @@ public final class MessagingAttributesExtractor * Creates the messaging attributes extractor for the given {@link MessageOperation operation} * with default configuration. */ - public static MessagingAttributesExtractor create( + public static AttributesExtractor create( MessagingAttributesGetter getter, MessageOperation operation) { return builder(getter, operation).build(); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorBuilder.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorBuilder.java index 009ea5a0f26f..25eee6ed869d 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorBuilder.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorBuilder.java @@ -8,6 +8,7 @@ import static java.util.Collections.emptyList; import com.google.errorprone.annotations.CanIgnoreReturnValue; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import java.util.List; /** A builder of {@link MessagingAttributesExtractor}. */ @@ -43,7 +44,7 @@ public MessagingAttributesExtractorBuilder setCapturedHeaders * Returns a new {@link MessagingAttributesExtractor} with the settings of this {@link * MessagingAttributesExtractorBuilder}. */ - public MessagingAttributesExtractor build() { + public AttributesExtractor build() { return new MessagingAttributesExtractor<>(getter, operation, capturedHeaders); } } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingSpanNameExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingSpanNameExtractor.java index 70bfb8d209c1..f6162deb80ff 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingSpanNameExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingSpanNameExtractor.java @@ -32,7 +32,6 @@ private MessagingSpanNameExtractor( this.operation = operation; } - @SuppressWarnings("deprecation") // operationName @Override public String extract(REQUEST request) { String destinationName = diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesExtractor.java index 0d1391af7d9f..4cfd9186d5d2 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesExtractor.java @@ -26,7 +26,7 @@ public final class NetClientAttributesExtractor private final InternalNetClientAttributesExtractor internalExtractor; - public static NetClientAttributesExtractor create( + public static AttributesExtractor create( NetClientAttributesGetter getter) { return new NetClientAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java index 16bfd1b90bd0..b1714855d4b1 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java @@ -23,7 +23,7 @@ public final class NetServerAttributesExtractor private final InternalNetServerAttributesExtractor internalExtractor; - public static NetServerAttributesExtractor create( + public static AttributesExtractor create( NetServerAttributesGetter getter) { return new NetServerAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/PeerServiceAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/PeerServiceAttributesExtractor.java index 0db34e79a4a5..dc49ee641fc8 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/PeerServiceAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/PeerServiceAttributesExtractor.java @@ -35,7 +35,7 @@ public final class PeerServiceAttributesExtractor * Returns a new {@link PeerServiceAttributesExtractor} that will use the passed {@code * netAttributesExtractor} instance to determine the value of the {@code peer.service} attribute. */ - public static PeerServiceAttributesExtractor create( + public static AttributesExtractor create( NetClientAttributesGetter attributesGetter, Map peerServiceMapping) { return new PeerServiceAttributesExtractor<>(attributesGetter, peerServiceMapping); diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java index 02f1de18fa58..33a0f2d796bc 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcClientAttributesExtractor.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.api.instrumenter.rpc; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.internal.SpanKey; import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider; @@ -20,7 +21,7 @@ public final class RpcClientAttributesExtractor extends RpcCommonAttributesExtractor implements SpanKeyProvider { /** Creates the RPC client attributes extractor. */ - public static RpcClientAttributesExtractor create( + public static AttributesExtractor create( RpcAttributesGetter getter) { return new RpcClientAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerAttributesExtractor.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerAttributesExtractor.java index 5beec4b096b8..eb3f2b7e17ce 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerAttributesExtractor.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcServerAttributesExtractor.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.api.instrumenter.rpc; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.internal.SpanKey; import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider; @@ -20,7 +21,7 @@ public final class RpcServerAttributesExtractor extends RpcCommonAttributesExtractor implements SpanKeyProvider { /** Creates the RPC server attributes extractor. */ - public static RpcServerAttributesExtractor create( + public static AttributesExtractor create( RpcAttributesGetter getter) { return new RpcServerAttributesExtractor<>(getter); } diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java index fbaa98844255..ee913bebf183 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesExtractorTest.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.HashMap; @@ -45,7 +46,7 @@ void shouldExtractAllAttributes() { Context context = Context.root(); - CodeAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = CodeAttributesExtractor.create(new TestAttributesGetter()); // when @@ -67,7 +68,7 @@ void shouldExtractAllAttributes() { @Test void shouldExtractNoAttributesIfNoneAreAvailable() { // given - CodeAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = CodeAttributesExtractor.create(new TestAttributesGetter()); // when diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractorTest.java index 9ccd8d212d06..ea7462c36833 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesExtractorTest.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.HashMap; @@ -64,7 +65,7 @@ void shouldExtractAllAvailableAttributes() { Context context = Context.root(); - DbClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = DbClientAttributesExtractor.create(new TestAttributesGetter()); // when @@ -90,7 +91,7 @@ void shouldExtractAllAvailableAttributes() { @Test void shouldExtractNoAttributesIfNoneAreAvailable() { // given - DbClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = DbClientAttributesExtractor.create(new TestAttributesGetter()); // when diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorTest.java index ff19c443ea61..066d19b6d6db 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesExtractorTest.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.Collections; import java.util.HashMap; @@ -60,7 +61,7 @@ void shouldExtractAllAttributes() { Context context = Context.root(); - SqlClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = SqlClientAttributesExtractor.create(new TestAttributesGetter()); // when @@ -92,7 +93,7 @@ void shouldNotExtractTableIfAttributeIsNotSet() { Context context = Context.root(); - SqlClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = SqlClientAttributesExtractor.create(new TestAttributesGetter()); // when @@ -114,7 +115,7 @@ void shouldExtractTableToSpecifiedKey() { Context context = Context.root(); - SqlClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = SqlClientAttributesExtractor., Void>builder(new TestAttributesGetter()) .setTableAttribute(SemanticAttributes.DB_CASSANDRA_TABLE) .build(); @@ -134,7 +135,7 @@ void shouldExtractTableToSpecifiedKey() { @Test void shouldExtractNoAttributesIfNoneAreAvailable() { // when - SqlClientAttributesExtractor, Void> underTest = + AttributesExtractor, Void> underTest = SqlClientAttributesExtractor.create(new TestAttributesGetter()); // when diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorTest.java index eb811e277a7f..7785b6547545 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesExtractorTest.java @@ -17,6 +17,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.HashMap; @@ -113,7 +114,7 @@ void normal() { response.put("header.custom-response-header", "654,321"); response.put("transport", IP_TCP); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.builder( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()) .setCapturedRequestHeaders(singletonList("Custom-Request-Header")) @@ -153,7 +154,7 @@ void stripBasicAuthTest(String url, String expectedResult) { Map request = new HashMap<>(); request.put("url", url); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.builder( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()) .build(); @@ -189,7 +190,7 @@ void invalidStatusCode() { Map response = new HashMap<>(); response.put("statusCode", "0"); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.builder( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()) .setCapturedRequestHeaders(emptyList()) @@ -209,7 +210,7 @@ void extractNetPeerNameAndPortFromHostHeader() { Map request = new HashMap<>(); request.put("header.host", "thehost:777"); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.create( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()); @@ -229,7 +230,7 @@ void extractNetHostAndPortFromNetAttributesGetter() { request.put("peerName", "thehost"); request.put("peerPort", "777"); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.create( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()); @@ -249,7 +250,7 @@ void defaultPeerPort(int peerPort, String url) { request.put("url", url); request.put("peerPort", String.valueOf(peerPort)); - HttpClientAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpClientAttributesExtractor.builder( new TestHttpClientAttributesGetter(), new TestNetClientAttributesGetter()) .build(); diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorTest.java index 60ce73cb7d65..4a8e1884df55 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesExtractorTest.java @@ -16,6 +16,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.HashMap; @@ -176,7 +177,7 @@ void extractClientIpFromX_Forwarded_For() { Map request = new HashMap<>(); request.put("header.x-forwarded-for", "1.1.1.1"); - HttpServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpServerAttributesExtractor.builder( new TestHttpServerAttributesGetter(), new TestNetServerAttributesGetter()) .setCapturedRequestHeaders(emptyList()) @@ -198,7 +199,7 @@ void extractClientIpFromX_Forwarded_Proto() { Map request = new HashMap<>(); request.put("header.x-forwarded-proto", "https"); - HttpServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpServerAttributesExtractor.builder( new TestHttpServerAttributesGetter(), new TestNetServerAttributesGetter()) .setCapturedRequestHeaders(emptyList()) @@ -218,7 +219,7 @@ void extractNetHostAndPortFromHostHeader() { Map request = new HashMap<>(); request.put("header.host", "thehost:777"); - HttpServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpServerAttributesExtractor.builder( new TestHttpServerAttributesGetter(), new TestNetServerAttributesGetter()) .setCapturedRequestHeaders(emptyList()) @@ -240,7 +241,7 @@ void extractNetHostAndPortFromNetAttributesGetter() { request.put("hostName", "thehost"); request.put("hostPort", 777); - HttpServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpServerAttributesExtractor.builder( new TestHttpServerAttributesGetter(), new TestNetServerAttributesGetter()) .setCapturedRequestHeaders(emptyList()) @@ -262,7 +263,7 @@ void defaultHostPort(int hostPort, String scheme) { request.put("scheme", scheme); request.put("hostPort", hostPort); - HttpServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = HttpServerAttributesExtractor.builder( new TestHttpServerAttributesGetter(), new TestNetServerAttributesGetter()) .setCapturedRequestHeaders(emptyList()) diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java index ee17a4bd4a51..8f845f1b02da 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesExtractorTest.java @@ -12,6 +12,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.ArrayList; import java.util.Collections; @@ -50,7 +51,7 @@ void shouldExtractAllAvailableAttributes( request.put("payloadSize", "100"); request.put("payloadCompressedSize", "10"); - MessagingAttributesExtractor, String> underTest = + AttributesExtractor, String> underTest = MessagingAttributesExtractor.create(TestGetter.INSTANCE, operation); Context context = Context.root(); @@ -97,7 +98,7 @@ static Stream destinations() { @Test void shouldExtractNoAttributesIfNoneAreAvailable() { // given - MessagingAttributesExtractor, String> underTest = + AttributesExtractor, String> underTest = MessagingAttributesExtractor.create(TestGetter.INSTANCE, MessageOperation.SEND); Context context = Context.root(); diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java index 37563731ae53..fc33b6d5e969 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.net.Inet4Address; import java.net.InetSocketAddress; @@ -47,7 +48,7 @@ protected InetSocketAddress getPeerSocketAddress( return response; } }; - private final NetClientAttributesExtractor extractor = + private final AttributesExtractor extractor = NetClientAttributesExtractor.create(getter); @Test diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java index 60cfbbf4798e..13dd7c9fe8a1 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.net.Inet4Address; import java.net.InetSocketAddress; @@ -51,7 +52,7 @@ protected InetSocketAddress getHostSocketAddress(Addresses request) { return request.host; } }; - private final NetServerAttributesExtractor extractor = + private final AttributesExtractor extractor = NetServerAttributesExtractor.create(getter); @Test diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java index bf5e92e9f04f..339275746d3b 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java @@ -13,6 +13,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import java.util.HashMap; import java.util.Map; @@ -74,7 +75,7 @@ public Integer getSockHostPort(Map request) { } } - NetServerAttributesExtractor, Map> extractor = + AttributesExtractor, Map> extractor = NetServerAttributesExtractor.create(new TestNetServerAttributesGetter()); @Test diff --git a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsInstrumenterFactory.java b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsInstrumenterFactory.java index 8f69e1be0c13..f8903ab378ff 100644 --- a/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsInstrumenterFactory.java +++ b/instrumentation/jms/jms-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jms/JmsInstrumenterFactory.java @@ -9,6 +9,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue; import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; import io.opentelemetry.instrumentation.api.instrumenter.messaging.MessageOperation; @@ -84,8 +85,8 @@ public Instrumenter createConsumerProcessInstrumen .buildConsumerInstrumenter(MessagePropertyGetter.INSTANCE); } - private MessagingAttributesExtractor - createMessagingAttributesExtractor(MessageOperation operation) { + private AttributesExtractor createMessagingAttributesExtractor( + MessageOperation operation) { return MessagingAttributesExtractor.builder(JmsMessageAttributesGetter.INSTANCE, operation) .setCapturedHeaders(capturedHeaders) .build(); diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java index 855b9798f891..773ab8c2f00b 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java +++ b/instrumentation/kafka/kafka-clients/kafka-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/internal/KafkaInstrumenterFactory.java @@ -171,7 +171,7 @@ public KafkaInstrumenterFactory setMessagingReceiveInstrumentationEnabled( } private static - MessagingAttributesExtractor buildMessagingAttributesExtractor( + AttributesExtractor buildMessagingAttributesExtractor( MessagingAttributesGetter getter, MessageOperation operation, List capturedHeaders) { diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java index 45c90ecf6dd7..f71bf0d29402 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java +++ b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/OpenTelemetryTracing.java @@ -24,6 +24,7 @@ import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.db.RedisCommandSanitizer; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesExtractor; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes.DbSystemValues; @@ -36,9 +37,8 @@ final class OpenTelemetryTracing implements Tracing { - private static final NetClientAttributesExtractor - netAttributesExtractor = - NetClientAttributesExtractor.create(new LettuceNetAttributesGetter()); + private static final AttributesExtractor netAttributesExtractor = + NetClientAttributesExtractor.create(new LettuceNetAttributesGetter()); private final TracerProvider tracerProvider; OpenTelemetryTracing(io.opentelemetry.api.trace.Tracer tracer, RedisCommandSanitizer sanitizer) { diff --git a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java index ca45054a004f..eb5a0d919ad1 100644 --- a/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java +++ b/instrumentation/mongo/mongo-3.1/library/src/main/java/io/opentelemetry/instrumentation/mongo/v3_1/MongoInstrumenterFactory.java @@ -7,6 +7,7 @@ import com.mongodb.event.CommandStartedEvent; import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; import io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor; @@ -17,8 +18,8 @@ class MongoInstrumenterFactory { private static final MongoAttributesExtractor attributesExtractor = new MongoAttributesExtractor(); - private static final NetClientAttributesExtractor - netAttributesExtractor = NetClientAttributesExtractor.create(new MongoNetAttributesGetter()); + private static final AttributesExtractor netAttributesExtractor = + NetClientAttributesExtractor.create(new MongoNetAttributesGetter()); static Instrumenter createInstrumenter( OpenTelemetry openTelemetry, diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java index 43a0a0469613..070ba7f6a61d 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java +++ b/instrumentation/rabbitmq-2.7/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rabbitmq/RabbitSingletons.java @@ -104,7 +104,7 @@ private static Instrumenter createDeliverInstrumenter() { .buildConsumerInstrumenter(DeliveryRequestGetter.INSTANCE); } - private static MessagingAttributesExtractor buildMessagingAttributesExtractor( + private static AttributesExtractor buildMessagingAttributesExtractor( MessagingAttributesGetter getter, MessageOperation operation) { return MessagingAttributesExtractor.builder(getter, operation) .setCapturedHeaders(ExperimentalConfig.get().getMessagingHeaders()) diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java index 4c811963f9e9..f5f6c0f9e2a3 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletInstrumenterFactory.java @@ -8,7 +8,6 @@ import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; -import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerAttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerMetrics; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; @@ -26,7 +25,7 @@ public final class RestletInstrumenterFactory { public static Instrumenter newServerInstrumenter( OpenTelemetry openTelemetry, - HttpServerAttributesExtractor httpServerAttributesExtractor, + AttributesExtractor httpServerAttributesExtractor, List> additionalExtractors) { RestletHttpAttributesGetter httpAttributesGetter = RestletHttpAttributesGetter.INSTANCE; diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java index 3b8cfe76a6c4..ddacdc576e24 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/src/main/java/io/opentelemetry/instrumentation/rocketmqclient/v4_8/RocketMqInstrumenterFactory.java @@ -10,6 +10,7 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.MESSAGING_SYSTEM; import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder; import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; @@ -123,7 +124,7 @@ private static Instrumenter createProcessInstrumenter( } } - private static MessagingAttributesExtractor buildMessagingAttributesExtractor( + private static AttributesExtractor buildMessagingAttributesExtractor( MessagingAttributesGetter getter, MessageOperation operation, List capturedHeaders) { diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqInstrumenterFactory.java b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqInstrumenterFactory.java index 8e0c841c223d..b2a0432ea8b6 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqInstrumenterFactory.java +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/rocketmqclient/v5_0/RocketMqInstrumenterFactory.java @@ -53,7 +53,7 @@ public static Instrumenter createProduce RocketMqConsumerReceiveAttributeGetter getter = RocketMqConsumerReceiveAttributeGetter.INSTANCE; MessageOperation operation = MessageOperation.RECEIVE; - MessagingAttributesExtractor> attributesExtractor = + AttributesExtractor> attributesExtractor = buildMessagingAttributesExtractor(getter, operation, capturedHeaders); InstrumenterBuilder> instrumenterBuilder = @@ -74,7 +74,7 @@ public static Instrumenter createConsumerProcessInst RocketMqConsumerProcessAttributeGetter getter = RocketMqConsumerProcessAttributeGetter.INSTANCE; MessageOperation operation = MessageOperation.PROCESS; - MessagingAttributesExtractor attributesExtractor = + AttributesExtractor attributesExtractor = buildMessagingAttributesExtractor(getter, operation, capturedHeaders); InstrumenterBuilder instrumenterBuilder = @@ -101,7 +101,7 @@ public static Instrumenter createConsumerProcessInst return instrumenterBuilder.buildConsumerInstrumenter(MessageMapGetter.INSTANCE); } - private static MessagingAttributesExtractor buildMessagingAttributesExtractor( + private static AttributesExtractor buildMessagingAttributesExtractor( MessagingAttributesGetter getter, MessageOperation operation, List capturedHeaders) { diff --git a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringIntegrationTelemetryBuilder.java b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringIntegrationTelemetryBuilder.java index 221f8c4239c4..2d95cce3b6c0 100644 --- a/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringIntegrationTelemetryBuilder.java +++ b/instrumentation/spring/spring-integration-4.1/library/src/main/java/io/opentelemetry/instrumentation/spring/integration/v4_1/SpringIntegrationTelemetryBuilder.java @@ -111,11 +111,10 @@ public SpringIntegrationTelemetry build() { producerSpanEnabled); } - private static MessagingAttributesExtractor - buildMessagingAttributesExtractor( - MessagingAttributesGetter getter, - MessageOperation operation, - List capturedHeaders) { + private static AttributesExtractor buildMessagingAttributesExtractor( + MessagingAttributesGetter getter, + MessageOperation operation, + List capturedHeaders) { return MessagingAttributesExtractor.builder(getter, operation) .setCapturedHeaders(capturedHeaders) .build();