From 51924fc89f33ea0ae596ed2a70060d6fa1795b88 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Thu, 16 Feb 2023 12:18:16 +0100 Subject: [PATCH 1/2] Remove deprecated instrumentation-api-semconv code --- .../code/CodeAttributesGetter.java | 32 +-- .../db/DbClientAttributesGetter.java | 32 +-- .../db/DbClientCommonAttributesGetter.java | 64 +----- .../db/SqlClientAttributesGetter.java | 19 +- .../http/HttpClientAttributesExtractor.java | 24 --- .../http/HttpClientAttributesGetter.java | 37 +--- .../http/HttpCommonAttributesGetter.java | 82 +------- .../instrumenter/http/HttpRouteHolder.java | 16 -- .../http/HttpServerAttributesGetter.java | 62 +----- .../messaging/MessagingAttributesGetter.java | 197 ++---------------- .../net/NetClientAttributesGetter.java | 96 +-------- .../net/NetServerAttributesGetter.java | 108 +--------- .../instrumenter/rpc/RpcAttributesGetter.java | 48 +---- .../AkkaHttpServerAttributesGetter.java | 6 - .../grizzly/GrizzlyHttpAttributesGetter.java | 6 - .../v1_0/KtorHttpServerAttributesGetter.kt | 4 - .../v2_0/KtorHttpServerAttributesGetter.kt | 4 - ...LibertyDispatcherHttpAttributesGetter.java | 6 - .../NettyHttpServerAttributesGetter.java | 6 - .../NettyHttpServerAttributesGetter.java | 6 - .../MockHttpServerAttributesGetter.java | 6 - .../v1_7/RatpackHttpAttributesGetter.java | 7 - .../v1_1/RestletHttpAttributesGetter.java | 6 - .../internal/RestletHttpAttributesGetter.java | 6 - .../servlet/ServletHttpAttributesGetter.java | 6 - .../SpringWebMvcHttpAttributesGetter.java | 6 - .../SpringWebMvcHttpAttributesGetter.java | 6 - .../common/TomcatHttpAttributesGetter.java | 6 - .../UndertowHttpAttributesGetter.java | 6 - 29 files changed, 42 insertions(+), 868 deletions(-) diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesGetter.java index 4e30b94401c0..5c6f62ddf611 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/code/CodeAttributesGetter.java @@ -17,36 +17,8 @@ public interface CodeAttributesGetter { @Nullable - default Class getCodeClass(REQUEST request) { - return codeClass(request); - } + Class getCodeClass(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getCodeClass(Object)} instead. - */ - @Deprecated @Nullable - default Class codeClass(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getMethodName(REQUEST request) { - return methodName(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMethodName(Object)} instead. - */ - @Deprecated - @Nullable - default String methodName(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getMethodName(REQUEST request); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesGetter.java index 28d1ede221f9..ffd57eab4f0f 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientAttributesGetter.java @@ -21,36 +21,8 @@ public interface DbClientAttributesGetter extends DbClientCommonAttributesGetter { @Nullable - default String getStatement(REQUEST request) { - return statement(request); - } + String getStatement(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getStatement(Object)} instead. - */ - @Deprecated @Nullable - default String statement(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getOperation(REQUEST request) { - return operation(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getOperation(Object)} instead. - */ - @Deprecated - @Nullable - default String operation(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getOperation(REQUEST request); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesGetter.java index 20d97cece50e..7d11cdaa1954 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/DbClientCommonAttributesGetter.java @@ -11,70 +11,14 @@ public interface DbClientCommonAttributesGetter { @Nullable - default String getSystem(REQUEST request) { - return system(request); - } + String getSystem(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSystem(Object)} instead. - */ - @Deprecated @Nullable - default String system(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getUser(REQUEST request); @Nullable - default String getUser(REQUEST request) { - return user(request); - } + String getName(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getUser(Object)} instead. - */ - @Deprecated @Nullable - default String user(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getName(REQUEST request) { - return name(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getName(Object)} instead. - */ - @Deprecated - @Nullable - default String name(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getConnectionString(REQUEST request) { - return connectionString(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getConnectionString(Object)} instead. - */ - @Deprecated - @Nullable - default String connectionString(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getConnectionString(REQUEST request); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesGetter.java index e001c10feebb..38ada758a1f6 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/db/SqlClientAttributesGetter.java @@ -26,22 +26,5 @@ public interface SqlClientAttributesGetter * SqlClientAttributesExtractor} before being set as span attribute. */ @Nullable - default String getRawStatement(REQUEST request) { - return rawStatement(request); - } - - /** - * Get the raw SQL statement. The value returned by this method is later sanitized by the {@link - * SqlClientAttributesExtractor} before being set as span attribute. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getRawStatement(Object)} instead. - */ - @Deprecated - @Nullable - default String rawStatement(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getRawStatement(REQUEST request); } 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 026d0207f8a6..8c7fef784841 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 @@ -32,17 +32,6 @@ public final class HttpClientAttributesExtractor REQUEST, RESPONSE, HttpClientAttributesGetter> implements SpanKeyProvider { - /** - * Creates the HTTP client attributes extractor with default configuration. - * - * @deprecated Use {@link #create(HttpClientAttributesGetter, NetClientAttributesGetter)} instead. - */ - @Deprecated - public static AttributesExtractor create( - HttpClientAttributesGetter getter) { - return builder(getter).build(); - } - /** Creates the HTTP client attributes extractor with default configuration. */ public static AttributesExtractor create( HttpClientAttributesGetter httpAttributesGetter, @@ -50,19 +39,6 @@ public static AttributesExtractor create( return builder(httpAttributesGetter, netAttributesGetter).build(); } - /** - * Returns a new {@link HttpClientAttributesExtractorBuilder} that can be used to configure the - * HTTP client attributes extractor. - * - * @deprecated Use {@link #builder(HttpClientAttributesGetter, NetClientAttributesGetter)} - * instead. - */ - @Deprecated - public static HttpClientAttributesExtractorBuilder builder( - HttpClientAttributesGetter httpAttributesGetter) { - return builder(httpAttributesGetter, new NoopNetClientAttributesGetter<>()); - } - /** * Returns a new {@link HttpClientAttributesExtractorBuilder} that can be used to configure the * HTTP client attributes extractor. diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesGetter.java index 20a1c68b04b7..5bf19dd50514 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpClientAttributesGetter.java @@ -22,21 +22,7 @@ public interface HttpClientAttributesGetter // Attributes that always exist in a request @Nullable - default String getUrl(REQUEST request) { - return url(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getUrl(Object)} instead. - */ - @Deprecated - @Nullable - default String url(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getUrl(REQUEST request); // Attributes which are not always available when the request is ready. @@ -47,24 +33,5 @@ default String url(REQUEST request) { * {@code response} is {@code null} or not. */ @Nullable - default String getFlavor(REQUEST request, @Nullable RESPONSE response) { - return flavor(request, response); - } - - /** - * Extracts the {@code http.flavor} span attribute. - * - *

This is called from {@link Instrumenter#end(Context, Object, Object, Throwable)}, whether - * {@code response} is {@code null} or not. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getFlavor(Object, Object)}. - */ - @Deprecated - @Nullable - default String flavor(REQUEST request, @Nullable RESPONSE response) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getFlavor(REQUEST request, @Nullable RESPONSE response); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpCommonAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpCommonAttributesGetter.java index fd668d1c6291..bed83bb368c6 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpCommonAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpCommonAttributesGetter.java @@ -16,21 +16,7 @@ public interface HttpCommonAttributesGetter { // Attributes that always exist in a request @Nullable - default String getMethod(REQUEST request) { - return method(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMethod(Object)} instead. - */ - @Deprecated - @Nullable - default String method(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getMethod(REQUEST request); /** * Extracts all values of header named {@code name} from the request, or an empty list if there @@ -39,26 +25,7 @@ default String method(REQUEST request) { *

Implementations of this method must not return a null value; an empty list should be * returned instead. */ - default List getRequestHeader(REQUEST request, String name) { - return requestHeader(request, name); - } - - /** - * Extracts all values of header named {@code name} from the request, or an empty list if there - * were none. - * - *

Implementations of this method must not return a null value; an empty list should be - * returned instead. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getRequestHeader(Object, String)} instead. - */ - @Deprecated - default List requestHeader(REQUEST request, String name) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + List getRequestHeader(REQUEST request, String name); // Attributes which are not always available when the request is ready. @@ -69,26 +36,7 @@ default List requestHeader(REQUEST request, String name) { * {@code response} is non-{@code null}. */ @Nullable - default Integer getStatusCode(REQUEST request, RESPONSE response, @Nullable Throwable error) { - return statusCode(request, response, error); - } - - /** - * Extracts the {@code http.status_code} span attribute. - * - *

This is called from {@link Instrumenter#end(Context, Object, Object, Throwable)}, only when - * {@code response} is non-{@code null}. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getStatusCode(Object, Object, Throwable)} instead. - */ - @Deprecated - @Nullable - default Integer statusCode(REQUEST request, RESPONSE response, @Nullable Throwable error) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + Integer getStatusCode(REQUEST request, RESPONSE response, @Nullable Throwable error); /** * Extracts all values of header named {@code name} from the response, or an empty list if there @@ -100,27 +48,5 @@ default Integer statusCode(REQUEST request, RESPONSE response, @Nullable Throwab *

Implementations of this method must not return a null value; an empty list should be * returned instead. */ - default List getResponseHeader(REQUEST request, RESPONSE response, String name) { - return responseHeader(request, response, name); - } - - /** - * Extracts all values of header named {@code name} from the response, or an empty list if there - * were none. - * - *

This is called from {@link Instrumenter#end(Context, Object, Object, Throwable)}, only when - * {@code response} is non-{@code null}. - * - *

Implementations of this method must not return a null value; an empty list should be - * returned instead. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getResponseHeader(Object, Object, String)} instead. - */ - @Deprecated - default List responseHeader(REQUEST request, RESPONSE response, String name) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + List getResponseHeader(REQUEST request, RESPONSE response, String name); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolder.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolder.java index bab62143c8cb..37eacad0d6c8 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolder.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpRouteHolder.java @@ -25,22 +25,6 @@ */ public final class HttpRouteHolder { - /** - * Returns a {@link ContextCustomizer} that initializes a {@link HttpRouteHolder} in the {@link - * Context} returned from {@link Instrumenter#start(Context, Object)}. - * - * @deprecated Use {@link #create(HttpServerAttributesGetter)} instead. - */ - @Deprecated - public static ContextCustomizer get() { - return (context, request, startAttributes) -> { - if (HttpRouteState.fromContextOrNull(context) != null) { - return context; - } - return context.with(HttpRouteState.create(null, null, 0)); - }; - } - /** * Returns a {@link ContextCustomizer} that initializes a {@link HttpRouteHolder} in the {@link * Context} returned from {@link Instrumenter#start(Context, Object)}. diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesGetter.java index eb9d7edb0dbd..85231dd9235e 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/http/HttpServerAttributesGetter.java @@ -20,70 +20,16 @@ public interface HttpServerAttributesGetter // Attributes that always exist in a request @Nullable - default String getFlavor(REQUEST request) { - return flavor(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getFlavor(Object)} instead. - */ - @Deprecated - @Nullable - default String flavor(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getFlavor(REQUEST request); @Nullable - default String getTarget(REQUEST request) { - return target(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getTarget(Object)} instead. - */ - @Deprecated - @Nullable - default String target(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getTarget(REQUEST request); @Nullable default String getRoute(REQUEST request) { - return route(request); + return null; } - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getRoute(Object)} instead. - */ - @Deprecated @Nullable - default String route(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getScheme(REQUEST request) { - return scheme(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getScheme(Object)} instead. - */ - @Deprecated - @Nullable - default String scheme(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getScheme(REQUEST request); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesGetter.java index d23046eed3cf..fe2c004e1bd0 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/messaging/MessagingAttributesGetter.java @@ -5,7 +5,8 @@ package io.opentelemetry.instrumentation.api.instrumenter.messaging; -import java.util.Collections; +import static java.util.Collections.emptyList; + import java.util.List; import javax.annotation.Nullable; @@ -19,189 +20,36 @@ public interface MessagingAttributesGetter { @Nullable - default String getSystem(REQUEST request) { - return system(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSystem(Object)} instead. - */ - @Deprecated - @Nullable - default String system(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getDestinationKind(REQUEST request) { - return destinationKind(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getDestinationKind(Object)} instead. - */ - @Deprecated - @Nullable - default String destinationKind(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getDestination(REQUEST request) { - return destination(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getDestination(Object)} instead. - */ - @Deprecated - @Nullable - default String destination(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - default boolean isTemporaryDestination(REQUEST request) { - return temporaryDestination(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #isTemporaryDestination(Object)} instead. - */ - @Deprecated - default boolean temporaryDestination(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getProtocol(REQUEST request) { - return protocol(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getProtocol(Object)} instead. - */ - @Deprecated - @Nullable - default String protocol(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getProtocolVersion(REQUEST request) { - return protocolVersion(request); - } + String getSystem(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getProtocolVersion(Object)} instead. - */ - @Deprecated @Nullable - default String protocolVersion(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getDestinationKind(REQUEST request); @Nullable - default String getUrl(REQUEST request) { - return url(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getUrl(Object)} instead. - */ - @Deprecated - @Nullable - default String url(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getDestination(REQUEST request); - @Nullable - default String getConversationId(REQUEST request) { - return conversationId(request); - } + boolean isTemporaryDestination(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getConversationId(Object)} instead. - */ - @Deprecated @Nullable - default String conversationId(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getProtocol(REQUEST request); @Nullable - default Long getMessagePayloadSize(REQUEST request) { - return messagePayloadSize(request); - } + String getProtocolVersion(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMessagePayloadSize(Object)} instead. - */ - @Deprecated @Nullable - default Long messagePayloadSize(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getUrl(REQUEST request); @Nullable - default Long getMessagePayloadCompressedSize(REQUEST request) { - return messagePayloadCompressedSize(request); - } + String getConversationId(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMessagePayloadCompressedSize(Object)} instead. - */ - @Deprecated @Nullable - default Long messagePayloadCompressedSize(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + Long getMessagePayloadSize(REQUEST request); @Nullable - default String getMessageId(REQUEST request, @Nullable RESPONSE response) { - return messageId(request, response); - } + Long getMessagePayloadCompressedSize(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMessageId(Object, Object)} instead. - */ - @Deprecated @Nullable - default String messageId(REQUEST request, @Nullable RESPONSE response) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getMessageId(REQUEST request, @Nullable RESPONSE response); /** * Extracts all values of header named {@code name} from the request, or an empty list if there @@ -210,24 +58,7 @@ default String messageId(REQUEST request, @Nullable RESPONSE response) { *

Implementations of this method must not return a null value; an empty list should be * returned instead. */ - // TODO: when removing header(), make sure this method returns emptyList() by default default List getMessageHeader(REQUEST request, String name) { - return header(request, name); - } - - /** - * Extracts all values of header named {@code name} from the request, or an empty list if there - * were none. - * - *

Implementations of this method must not return a null value; an empty list should be - * returned instead. - * - *

This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMessageHeader(Object, String)} instead. - */ - @Deprecated - default List header(REQUEST request, String name) { - return Collections.emptyList(); + return emptyList(); } } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java index 539f6db2e5b8..4541bd82a43d 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java @@ -18,121 +18,31 @@ public interface NetClientAttributesGetter { @Nullable - default String getTransport(REQUEST request, @Nullable RESPONSE response) { - return transport(request, response); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getTransport(Object, Object)} instead. - */ - @Deprecated - @Nullable - default String transport(REQUEST request, @Nullable RESPONSE response) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getPeerName(REQUEST request) { - return peerName(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getPeerName(Object)} instead. - */ - @Deprecated - @Nullable - default String peerName(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getTransport(REQUEST request, @Nullable RESPONSE response); @Nullable - default Integer getPeerPort(REQUEST request) { - return peerPort(request); - } + String getPeerName(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getPeerPort(Object)} instead. - */ - @Deprecated @Nullable - default Integer peerPort(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + Integer getPeerPort(REQUEST request); - // TODO: when removing sockFamily(), make sure this method returns null by default @Nullable default String getSockFamily(REQUEST request, @Nullable RESPONSE response) { - return sockFamily(request, response); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockFamily(Object, Object)} instead. - */ - @Deprecated - @Nullable - default String sockFamily(REQUEST request, @Nullable RESPONSE response) { return null; } - // TODO: when removing sockPeerAddr(), make sure this method returns null by default @Nullable default String getSockPeerAddr(REQUEST request, @Nullable RESPONSE response) { - return sockPeerAddr(request, response); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockPeerAddr(Object, Object)} instead. - */ - @Deprecated - @Nullable - default String sockPeerAddr(REQUEST request, @Nullable RESPONSE response) { return null; } - // TODO: when removing sockPeerName(), make sure this method returns null by default @Nullable default String getSockPeerName(REQUEST request, @Nullable RESPONSE response) { - return sockPeerName(request, response); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockPeerName(Object, Object)} instead. - */ - @Deprecated - @Nullable - default String sockPeerName(REQUEST request, @Nullable RESPONSE response) { return null; } - // TODO: when removing sockPeerPort(), make sure this method returns null by default @Nullable default Integer getSockPeerPort(REQUEST request, @Nullable RESPONSE response) { - return sockPeerPort(request, response); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockPeerName(Object, Object)} instead. - */ - @Deprecated - @Nullable - default Integer sockPeerPort(REQUEST request, @Nullable RESPONSE response) { return null; } } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java index 25a0ad498ed4..7f41fa30279c 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java @@ -18,138 +18,36 @@ public interface NetServerAttributesGetter { @Nullable - default String getTransport(REQUEST request) { - return transport(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getTransport(Object)} instead. - */ - @Deprecated - @Nullable - default String transport(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getHostName(REQUEST request) { - return hostName(request); - } + String getTransport(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getHostName(Object)} instead. - */ - @Deprecated @Nullable - default String hostName(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getHostName(REQUEST request); @Nullable - default Integer getHostPort(REQUEST request) { - return hostPort(request); - } + Integer getHostPort(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getHostPort(Object)} instead. - */ - @Deprecated - @Nullable - default Integer hostPort(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - // TODO: when removing sockFamily(), make sure this method returns null by default @Nullable default String getSockFamily(REQUEST request) { - return sockFamily(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockFamily(Object)} instead. - */ - @Deprecated - @Nullable - default String sockFamily(REQUEST request) { return null; } - // TODO: when removing sockPeerAddr(), make sure this method returns null by default @Nullable default String getSockPeerAddr(REQUEST request) { - return sockPeerAddr(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockPeerAddr(Object)} instead. - */ - @Deprecated - @Nullable - default String sockPeerAddr(REQUEST request) { return null; } - // TODO: when removing sockPeerPort(), make sure this method returns null by default @Nullable default Integer getSockPeerPort(REQUEST request) { - return sockPeerPort(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockPeerPort(Object)} instead. - */ - @Deprecated - @Nullable - default Integer sockPeerPort(REQUEST request) { return null; } - // TODO: when removing sockHostAddr(), make sure this method returns null by default @Nullable default String getSockHostAddr(REQUEST request) { - return sockHostAddr(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockHostAddr(Object)} instead. - */ - @Deprecated - @Nullable - default String sockHostAddr(REQUEST request) { return null; } - // TODO: when removing sockHostPort(), make sure this method returns null by default @Nullable default Integer getSockHostPort(REQUEST request) { - return sockHostPort(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSockHostPort(Object)} instead. - */ - @Deprecated - @Nullable - default Integer sockHostPort(REQUEST request) { return null; } } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcAttributesGetter.java index cfb2e76aa595..a22fe4cb5df8 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/rpc/RpcAttributesGetter.java @@ -17,53 +17,11 @@ public interface RpcAttributesGetter { @Nullable - default String getSystem(REQUEST request) { - return system(request); - } + String getSystem(REQUEST request); - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getSystem(Object)} instead. - */ - @Deprecated @Nullable - default String system(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getService(REQUEST request); @Nullable - default String getService(REQUEST request) { - return service(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getService(Object)} instead. - */ - @Deprecated - @Nullable - default String service(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } - - @Nullable - default String getMethod(REQUEST request) { - return method(request); - } - - /** - * This method is deprecated and will be removed in the subsequent release. - * - * @deprecated Use {@link #getMethod(Object)} instead. - */ - @Deprecated - @Nullable - default String method(REQUEST request) { - throw new UnsupportedOperationException( - "This method is deprecated and will be removed in the subsequent release."); - } + String getMethod(REQUEST request); } diff --git a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java index 88d8f3992c11..e6e77f6775ac 100644 --- a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java +++ b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerAttributesGetter.java @@ -53,12 +53,6 @@ public String getTarget(HttpRequest request) { return target; } - @Override - @Nullable - public String getRoute(HttpRequest request) { - return null; - } - @Override public String getScheme(HttpRequest request) { return request.uri().scheme(); diff --git a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyHttpAttributesGetter.java b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyHttpAttributesGetter.java index adb892bbec6f..6574bc07a9d7 100644 --- a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyHttpAttributesGetter.java +++ b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyHttpAttributesGetter.java @@ -68,12 +68,6 @@ public String getTarget(HttpRequestPacket request) { return target; } - @Nullable - @Override - public String getRoute(HttpRequestPacket request) { - return null; - } - @Override public String getScheme(HttpRequestPacket request) { return request.isSecure() ? "https" : "http"; diff --git a/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorHttpServerAttributesGetter.kt b/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorHttpServerAttributesGetter.kt index 277675b88aaa..7155c996e5b1 100644 --- a/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorHttpServerAttributesGetter.kt +++ b/instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorHttpServerAttributesGetter.kt @@ -43,10 +43,6 @@ internal enum class KtorHttpServerAttributesGetter : return request.uri } - override fun getRoute(request: ApplicationRequest): String? { - return null - } - override fun getScheme(request: ApplicationRequest): String { return request.origin.scheme } diff --git a/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorHttpServerAttributesGetter.kt b/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorHttpServerAttributesGetter.kt index f5047152d675..09025a366cac 100644 --- a/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorHttpServerAttributesGetter.kt +++ b/instrumentation/ktor/ktor-2.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v2_0/KtorHttpServerAttributesGetter.kt @@ -43,10 +43,6 @@ internal enum class KtorHttpServerAttributesGetter : return request.uri } - override fun getRoute(request: ApplicationRequest): String? { - return null - } - override fun getScheme(request: ApplicationRequest): String { return request.origin.scheme } diff --git a/instrumentation/liberty/liberty-dispatcher-20.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherHttpAttributesGetter.java b/instrumentation/liberty/liberty-dispatcher-20.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherHttpAttributesGetter.java index 18f353ddb925..36069c1a026f 100644 --- a/instrumentation/liberty/liberty-dispatcher-20.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherHttpAttributesGetter.java +++ b/instrumentation/liberty/liberty-dispatcher-20.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/liberty/dispatcher/LibertyDispatcherHttpAttributesGetter.java @@ -65,10 +65,4 @@ public String getTarget(LibertyRequest libertyRequest) { public String getScheme(LibertyRequest libertyRequest) { return libertyRequest.getScheme(); } - - @Override - @Nullable - public String getRoute(LibertyRequest libertyRequest) { - return null; - } } diff --git a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyHttpServerAttributesGetter.java b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyHttpServerAttributesGetter.java index e36e31934677..bb0d3641069d 100644 --- a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyHttpServerAttributesGetter.java +++ b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/server/NettyHttpServerAttributesGetter.java @@ -51,12 +51,6 @@ public String getTarget(HttpRequestAndChannel requestAndChannel) { return requestAndChannel.request().getUri(); } - @Override - @Nullable - public String getRoute(HttpRequestAndChannel requestAndChannel) { - return null; - } - @Override public String getScheme(HttpRequestAndChannel requestAndChannel) { return HttpSchemeUtil.getScheme(requestAndChannel); diff --git a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/server/NettyHttpServerAttributesGetter.java b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/server/NettyHttpServerAttributesGetter.java index d1588fd1fc1b..b0e26a7ab951 100644 --- a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/server/NettyHttpServerAttributesGetter.java +++ b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/server/NettyHttpServerAttributesGetter.java @@ -51,12 +51,6 @@ public String getTarget(HttpRequestAndChannel requestAndChannel) { return requestAndChannel.request().getUri(); } - @Override - @Nullable - public String getRoute(HttpRequestAndChannel requestAndChannel) { - return null; - } - @Override public String getScheme(HttpRequestAndChannel requestAndChannel) { return HttpSchemeUtil.getScheme(requestAndChannel); diff --git a/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/MockHttpServerAttributesGetter.java b/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/MockHttpServerAttributesGetter.java index 537c88c8ec7b..72140613d20d 100644 --- a/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/MockHttpServerAttributesGetter.java +++ b/instrumentation/opentelemetry-instrumentation-api/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/testing/MockHttpServerAttributesGetter.java @@ -49,12 +49,6 @@ public String getTarget(String s) { return null; } - @Nullable - @Override - public String getRoute(String s) { - return null; - } - @Nullable @Override public String getScheme(String s) { diff --git a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/RatpackHttpAttributesGetter.java b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/RatpackHttpAttributesGetter.java index 119e84e29a27..b1c3127e4a03 100644 --- a/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/RatpackHttpAttributesGetter.java +++ b/instrumentation/ratpack/ratpack-1.7/library/src/main/java/io/opentelemetry/instrumentation/ratpack/v1_7/RatpackHttpAttributesGetter.java @@ -28,13 +28,6 @@ public String getTarget(Request request) { return request.getUri(); } - @Override - @Nullable - public String getRoute(Request request) { - // Ratpack route not available at the beginning of request. - return null; - } - @Override @Nullable public String getScheme(Request request) { diff --git a/instrumentation/restlet/restlet-1.1/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_1/RestletHttpAttributesGetter.java b/instrumentation/restlet/restlet-1.1/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_1/RestletHttpAttributesGetter.java index f392ec163d3a..7cc8b6a5c003 100644 --- a/instrumentation/restlet/restlet-1.1/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_1/RestletHttpAttributesGetter.java +++ b/instrumentation/restlet/restlet-1.1/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_1/RestletHttpAttributesGetter.java @@ -36,12 +36,6 @@ public String getTarget(Request request) { return ref.hasQuery() ? path + "?" + ref.getQuery() : path; } - @Override - @Nullable - public String getRoute(Request request) { - return null; - } - @Override @Nullable public String getScheme(Request request) { diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletHttpAttributesGetter.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletHttpAttributesGetter.java index 027927a7d64d..694eb0efaf5e 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletHttpAttributesGetter.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletHttpAttributesGetter.java @@ -38,12 +38,6 @@ public String getTarget(Request request) { return ref.hasQuery() ? path + "?" + ref.getQuery() : path; } - @Override - @Nullable - public String getRoute(Request request) { - return null; - } - @Override @Nullable public String getScheme(Request request) { diff --git a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletHttpAttributesGetter.java b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletHttpAttributesGetter.java index 78da671295a8..2817921d5a0e 100644 --- a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletHttpAttributesGetter.java +++ b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletHttpAttributesGetter.java @@ -93,10 +93,4 @@ public List getResponseHeader( String name) { return accessor.getResponseHeaderValues(responseContext.response(), name); } - - @Override - @Nullable - public String getRoute(ServletRequestContext requestContext) { - return null; - } } diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v5_3/SpringWebMvcHttpAttributesGetter.java b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v5_3/SpringWebMvcHttpAttributesGetter.java index 39f9707e0702..1b124f6c4693 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v5_3/SpringWebMvcHttpAttributesGetter.java +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v5_3/SpringWebMvcHttpAttributesGetter.java @@ -87,12 +87,6 @@ public String getTarget(HttpServletRequest request) { return target; } - @Override - @Nullable - public String getRoute(HttpServletRequest request) { - return null; - } - @Override @Nullable public String getScheme(HttpServletRequest request) { diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v6_0/SpringWebMvcHttpAttributesGetter.java b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v6_0/SpringWebMvcHttpAttributesGetter.java index cb68aa59420b..8b9339fb8d48 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v6_0/SpringWebMvcHttpAttributesGetter.java +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/v6_0/SpringWebMvcHttpAttributesGetter.java @@ -87,12 +87,6 @@ public String getTarget(HttpServletRequest request) { return target; } - @Override - @Nullable - public String getRoute(HttpServletRequest request) { - return null; - } - @Override @Nullable public String getScheme(HttpServletRequest request) { diff --git a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatHttpAttributesGetter.java b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatHttpAttributesGetter.java index 140aea246c54..ffc208a29daa 100644 --- a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatHttpAttributesGetter.java +++ b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatHttpAttributesGetter.java @@ -68,10 +68,4 @@ public Integer getStatusCode(Request request, Response response, @Nullable Throw public List getResponseHeader(Request request, Response response, String name) { return Collections.list(response.getMimeHeaders().values(name)); } - - @Override - @Nullable - public String getRoute(Request request) { - return null; - } } diff --git a/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpAttributesGetter.java b/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpAttributesGetter.java index b8e1768b1b9b..4ff76d528bea 100644 --- a/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpAttributesGetter.java +++ b/instrumentation/undertow-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/undertow/UndertowHttpAttributesGetter.java @@ -65,10 +65,4 @@ public String getTarget(HttpServerExchange exchange) { public String getScheme(HttpServerExchange exchange) { return exchange.getRequestScheme(); } - - @Override - @Nullable - public String getRoute(HttpServerExchange exchange) { - return null; - } } From ab776384bb3028478c5b765c228abac5504a0833 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Thu, 16 Feb 2023 13:13:05 +0100 Subject: [PATCH 2/2] remove unused class --- .../http/HttpClientAttributesExtractor.java | 22 ------------------- 1 file changed, 22 deletions(-) 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 8c7fef784841..47f9a3e80f85 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 @@ -151,26 +151,4 @@ public void onEnd( public SpanKey internalGetSpanKey() { return SpanKey.HTTP_CLIENT; } - - private static final class NoopNetClientAttributesGetter - implements NetClientAttributesGetter { - - @Nullable - @Override - public String getTransport(REQUEST request, @Nullable RESPONSE response) { - return null; - } - - @Nullable - @Override - public String getPeerName(REQUEST request) { - return null; - } - - @Nullable - @Override - public Integer getPeerPort(REQUEST request) { - return null; - } - } }