diff --git a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientAdditionalAttributesExtractor.java b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientAdditionalAttributesExtractor.java deleted file mode 100644 index 7d7c5f0987e4..000000000000 --- a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientAdditionalAttributesExtractor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.javaagent.instrumentation.asynchttpclient.v2_0; - -import io.opentelemetry.api.common.AttributesBuilder; -import io.opentelemetry.context.Context; -import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; -import io.opentelemetry.semconv.SemanticAttributes; -import javax.annotation.Nullable; -import org.asynchttpclient.Response; -import org.asynchttpclient.netty.request.NettyRequest; - -public class AsyncHttpClientAdditionalAttributesExtractor - implements AttributesExtractor { - - @Override - public void onStart( - AttributesBuilder attributes, Context parentContext, RequestContext requestContext) {} - - @Override - public void onEnd( - AttributesBuilder attributes, - Context context, - RequestContext requestContext, - @Nullable Response response, - @Nullable Throwable error) { - - NettyRequest nettyRequest = requestContext.getNettyRequest(); - if (nettyRequest != null) { - String userAgent = nettyRequest.getHttpRequest().headers().get("User-Agent"); - if (userAgent != null) { - attributes.put(SemanticAttributes.USER_AGENT_ORIGINAL, userAgent); - } - } - } -} diff --git a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java index 8efc89058487..ed902b20ba90 100644 --- a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java +++ b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java @@ -43,7 +43,6 @@ public final class AsyncHttpClientSingletons { .addAttributesExtractor( HttpClientPeerServiceAttributesExtractor.create( httpAttributesGetter, CommonConfig.get().getPeerServiceResolver())) - .addAttributesExtractor(new AsyncHttpClientAdditionalAttributesExtractor()) .addOperationMetrics(HttpClientMetrics.get()); if (CommonConfig.get().shouldEmitExperimentalHttpClientMetrics()) { builder.addOperationMetrics(HttpClientExperimentalMetrics.get()); diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy index eca88add714d..1a66b2f6c494 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy @@ -205,7 +205,6 @@ class S3TracingTest extends AgentInstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" String - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" String "$SemanticAttributes.NET_PROTOCOL_NAME" "http" "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1" @@ -572,7 +571,6 @@ class S3TracingTest extends AgentInstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" String - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" String "$SemanticAttributes.NET_PROTOCOL_NAME" "http" "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1" diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy index 6aa9557cb2ac..e702c04fec4b 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy @@ -189,7 +189,6 @@ class SnsTracingTest extends AgentInstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" String - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" String "$SemanticAttributes.NET_PROTOCOL_NAME" "http" "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1" diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractSqsTracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractSqsTracingTest.groovy index 67c8543e721f..c2c6b8826774 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractSqsTracingTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractSqsTracingTest.groovy @@ -123,7 +123,6 @@ abstract class AbstractSqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" "http://localhost:$sqsPort" - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" @@ -213,7 +212,6 @@ abstract class AbstractSqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" "http://localhost:$sqsPort" - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java index f4c060658ff2..1eb7bd5b4a06 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java @@ -23,7 +23,6 @@ import java.io.InputStreamReader; import java.nio.charset.Charset; import java.time.Instant; -import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Nullable; @@ -322,7 +321,6 @@ public void afterExecution( executionAttributes.putAttribute(SDK_HTTP_REQUEST_ATTRIBUTE, context.httpRequest()); Span span = Span.fromContext(otelContext); - onUserAgentHeaderAvailable(span, executionAttributes); onSdkResponse(span, context.response(), executionAttributes); SdkHttpResponse httpResponse = context.httpResponse(); @@ -336,15 +334,6 @@ public void afterExecution( clearAttributes(executionAttributes); } - // Certain headers in the request like User-Agent are only available after execution. - private static void onUserAgentHeaderAvailable(Span span, ExecutionAttributes request) { - List userAgent = - AwsSdkInstrumenterFactory.httpAttributesGetter.getHttpRequestHeader(request, "User-Agent"); - if (!userAgent.isEmpty()) { - span.setAttribute(SemanticAttributes.USER_AGENT_ORIGINAL, userAgent.get(0)); - } - } - private void onSdkResponse( Span span, SdkResponse response, ExecutionAttributes executionAttributes) { if (captureExperimentalSpanAttributes) { diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.groovy index 593241c044e0..cf216cb0f591 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientCoreTest.groovy @@ -138,7 +138,6 @@ abstract class AbstractAws2ClientCoreTest extends InstrumentationSpecification { "$SemanticAttributes.HTTP_URL" { it.startsWith("${server.httpUri()}${path}") } "$SemanticAttributes.HTTP_METHOD" "$method" "$SemanticAttributes.HTTP_STATUS_CODE" 200 - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it.startsWith("aws-sdk-java/") } "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.RPC_SYSTEM" "aws-api" @@ -174,7 +173,6 @@ abstract class AbstractAws2ClientCoreTest extends InstrumentationSpecification { "$SemanticAttributes.HTTP_URL" { it.startsWith("${server.httpUri()}${path}") } "$SemanticAttributes.HTTP_METHOD" "$method" "$SemanticAttributes.HTTP_STATUS_CODE" 200 - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it.startsWith("aws-sdk-java/") } "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.RPC_SYSTEM" "aws-api" @@ -209,7 +207,6 @@ abstract class AbstractAws2ClientCoreTest extends InstrumentationSpecification { "$SemanticAttributes.HTTP_URL" { it.startsWith("${server.httpUri()}${path}") } "$SemanticAttributes.HTTP_METHOD" "$method" "$SemanticAttributes.HTTP_STATUS_CODE" 200 - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it.startsWith("aws-sdk-java/") } "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.RPC_SYSTEM" "aws-api" diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy index 1d8218b6f45e..f852619a4f44 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy @@ -101,7 +101,6 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest { "$SemanticAttributes.NET_PEER_PORT" server.httpPort() "$SemanticAttributes.HTTP_METHOD" "$method" "$SemanticAttributes.HTTP_STATUS_CODE" 200 - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it.startsWith("aws-sdk-java/") } "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.RPC_SYSTEM" "aws-api" @@ -204,7 +203,6 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest { "$SemanticAttributes.NET_PEER_PORT" server.httpPort() "$SemanticAttributes.HTTP_METHOD" "$method" "$SemanticAttributes.HTTP_STATUS_CODE" 200 - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it.startsWith("aws-sdk-java/") } "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } "$SemanticAttributes.RPC_SYSTEM" "aws-api" @@ -333,7 +331,6 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest { "$SemanticAttributes.RPC_SYSTEM" "aws-api" "$SemanticAttributes.RPC_SERVICE" "S3" "$SemanticAttributes.RPC_METHOD" "GetObject" - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "aws.agent" "java-aws-sdk" "aws.bucket.name" "somebucket" } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2SqsTracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2SqsTracingTest.groovy index 705ce85fd693..f6f957b7ecc8 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2SqsTracingTest.groovy +++ b/instrumentation/aws-sdk/aws-sdk-2.2/testing/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2SqsTracingTest.groovy @@ -128,7 +128,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } @@ -151,7 +150,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" @@ -174,7 +172,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" @@ -210,7 +207,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long } @@ -321,7 +317,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" @@ -345,7 +340,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.method" "POST" "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.name" "localhost" "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" @@ -376,7 +370,6 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification { "http.status_code" 200 "http.url" { it.startsWith("http://localhost:$sqsPort") } "net.peer.name" "localhost" - "$SemanticAttributes.USER_AGENT_ORIGINAL" String "net.peer.port" sqsPort "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS" "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "testSdkSqs" diff --git a/instrumentation/camel-2.20/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/aws/AwsSpanAssertions.java b/instrumentation/camel-2.20/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/aws/AwsSpanAssertions.java index 0b99ed6bdb80..91a446b2e8b1 100644 --- a/instrumentation/camel-2.20/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/aws/AwsSpanAssertions.java +++ b/instrumentation/camel-2.20/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachecamel/aws/AwsSpanAssertions.java @@ -79,12 +79,6 @@ static SpanDataAssert sqs( val -> val.satisfiesAnyOf( v -> assertThat(v).isNull(), v -> assertThat(v).isInstanceOf(Long.class))), - satisfies( - SemanticAttributes.USER_AGENT_ORIGINAL, - val -> - val.satisfiesAnyOf( - v -> assertThat(v).isNull(), - v -> assertThat(v).isInstanceOf(String.class))), satisfies(SemanticAttributes.HTTP_URL, val -> val.isInstanceOf(String.class)), satisfies( stringKey("net.peer.name"), diff --git a/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/apiclient/ElasticsearchClientTest.java b/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/apiclient/ElasticsearchClientTest.java index 0770dcf4c308..07fc5e7ad6a9 100644 --- a/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/apiclient/ElasticsearchClientTest.java +++ b/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/apiclient/ElasticsearchClientTest.java @@ -14,7 +14,6 @@ import co.elastic.clients.elasticsearch.core.InfoResponse; import co.elastic.clients.json.jackson.JacksonJsonpMapper; import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Version; import co.elastic.clients.transport.rest_client.RestClientTransport; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.SpanKind; @@ -76,10 +75,6 @@ static void cleanUp() { elasticsearch.stop(); } - private static String userAgent() { - return "elastic-java/" + Version.VERSION + " (Java/" + System.getProperty("java.version") + ")"; - } - @Test public void elasticsearchStatus() throws IOException { InfoResponse response = client.info(); @@ -111,7 +106,6 @@ public void elasticsearchStatus() throws IOException { equalTo(SemanticAttributes.NET_PROTOCOL_VERSION, "1.1"), equalTo(SemanticAttributes.HTTP_URL, httpHost.toURI() + "/"), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200L), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, userAgent()), satisfies( SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH, AbstractLongAssert::isPositive)))); @@ -162,7 +156,6 @@ public void elasticsearchIndex() throws IOException { SemanticAttributes.HTTP_URL, httpHost.toURI() + "/test-index/_doc/test-id?timeout=10s"), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 201L), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, userAgent()), satisfies( SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH, AbstractLongAssert::isPositive)))); @@ -218,7 +211,6 @@ public void elasticsearchStatusAsync() throws Exception { equalTo(SemanticAttributes.NET_PROTOCOL_VERSION, "1.1"), equalTo(SemanticAttributes.HTTP_URL, httpHost.toURI() + "/"), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200L), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, userAgent()), satisfies( SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH, AbstractLongAssert::isPositive)), diff --git a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/groovy/JaxRsClientTest.groovy b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/groovy/JaxRsClientTest.groovy index 43cdf4d74456..1ab19154bbf8 100644 --- a/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/groovy/JaxRsClientTest.groovy +++ b/instrumentation/jaxrs-client/jaxrs-client-2.0-testing/src/test/groovy/JaxRsClientTest.groovy @@ -115,7 +115,6 @@ abstract class JaxRsClientTest extends HttpClientTest implem "$SemanticAttributes.HTTP_URL" "${uri}" "$SemanticAttributes.HTTP_METHOD" method "$SemanticAttributes.HTTP_STATUS_CODE" statusCode - "$SemanticAttributes.USER_AGENT_ORIGINAL" { it == null || it instanceof String } "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long } } } diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java index f52f9b851994..818d67ce339d 100644 --- a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/library/src/main/java/io/opentelemetry/instrumentation/jetty/httpclient/v9_2/internal/JettyHttpClient9TracingInterceptor.java @@ -5,11 +5,9 @@ package io.opentelemetry.instrumentation.jetty.httpclient.v9_2.internal; -import io.opentelemetry.api.trace.Span; import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; -import io.opentelemetry.semconv.SemanticAttributes; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Proxy; import java.util.ArrayList; @@ -20,8 +18,6 @@ import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; -import org.eclipse.jetty.http.HttpField; -import org.eclipse.jetty.http.HttpHeader; /** * JettyHttpClient9TracingInterceptor does three jobs stimulated from the Jetty Request object from @@ -137,15 +133,7 @@ private void startSpan(Request request) { } @Override - public void onBegin(Request request) { - if (this.context != null) { - Span span = Span.fromContext(this.context); - HttpField agentField = request.getHeaders().getField(HttpHeader.USER_AGENT); - if (agentField != null) { - span.setAttribute(SemanticAttributes.USER_AGENT_ORIGINAL, agentField.getValue()); - } - } - } + public void onBegin(Request request) {} @Override public void onComplete(Result result) { diff --git a/instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientTest.java b/instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientTest.java index 37e3e22d612b..386177ee3188 100644 --- a/instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientTest.java +++ b/instrumentation/kubernetes-client-7.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/kubernetesclient/KubernetesClientTest.java @@ -84,7 +84,6 @@ void synchronousCall() throws ApiException { mockWebServer.httpUri() + "/api/v1/namespaces/namespace/pods/name/proxy?path=path"), equalTo(SemanticAttributes.HTTP_METHOD, "GET"), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, TEST_USER_AGENT), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200), equalTo(SemanticAttributes.NET_PEER_NAME, "127.0.0.1"), equalTo(SemanticAttributes.NET_PEER_PORT, mockWebServer.httpPort()), @@ -135,7 +134,6 @@ void handleErrorsInSyncCall() { mockWebServer.httpUri() + "/api/v1/namespaces/namespace/pods/name/proxy?path=path"), equalTo(SemanticAttributes.HTTP_METHOD, "GET"), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, TEST_USER_AGENT), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 451), equalTo(SemanticAttributes.NET_PEER_NAME, "127.0.0.1"), equalTo(SemanticAttributes.NET_PEER_PORT, mockWebServer.httpPort()), @@ -192,7 +190,6 @@ public void onSuccess( mockWebServer.httpUri() + "/api/v1/namespaces/namespace/pods/name/proxy?path=path"), equalTo(SemanticAttributes.HTTP_METHOD, "GET"), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, TEST_USER_AGENT), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200), equalTo(SemanticAttributes.NET_PEER_NAME, "127.0.0.1"), equalTo(SemanticAttributes.NET_PEER_PORT, mockWebServer.httpPort()), @@ -257,7 +254,6 @@ public void onFailure( mockWebServer.httpUri() + "/api/v1/namespaces/namespace/pods/name/proxy?path=path"), equalTo(SemanticAttributes.HTTP_METHOD, "GET"), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, TEST_USER_AGENT), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 451), equalTo(SemanticAttributes.NET_PEER_NAME, "127.0.0.1"), equalTo(SemanticAttributes.NET_PEER_PORT, mockWebServer.httpPort()), diff --git a/instrumentation/okhttp/okhttp-3.0/testing/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/AbstractOkHttp3Test.java b/instrumentation/okhttp/okhttp-3.0/testing/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/AbstractOkHttp3Test.java index 0e5056202028..4b2a095ae7bb 100644 --- a/instrumentation/okhttp/okhttp-3.0/testing/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/AbstractOkHttp3Test.java +++ b/instrumentation/okhttp/okhttp-3.0/testing/src/main/java/io/opentelemetry/instrumentation/okhttp/v3_0/AbstractOkHttp3Test.java @@ -122,10 +122,6 @@ protected void configure(HttpClientTestOptions.Builder optionsBuilder) { uri -> { Set> attributes = new HashSet<>(HttpClientTestOptions.DEFAULT_HTTP_ATTRIBUTES); - // the tests are capturing the user-agent, but since it's not possible to override it in - // the builder, and since it contains the okhttp library version, let's just skip - // verification on this attribute - attributes.remove(SemanticAttributes.USER_AGENT_ORIGINAL); if (SemconvStability.emitOldHttpSemconv()) { // protocol is extracted from the response, and those URLs cause exceptions (= null diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/AbstractReactorNettyHttpClientTest.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/AbstractReactorNettyHttpClientTest.java index 6b5c2b65b6b2..a0503b9c976f 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/AbstractReactorNettyHttpClientTest.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/AbstractReactorNettyHttpClientTest.java @@ -44,6 +44,8 @@ abstract class AbstractReactorNettyHttpClientTest extends AbstractHttpClientTest> { + static final String USER_AGENT = "ReactorNetty"; + @RegisterExtension static final InstrumentationExtension testing = HttpClientInstrumentationExtension.forAgent(); diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyBaseUrlOnlyTest.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyBaseUrlOnlyTest.java index 357ef3d10c23..14d9d565eced 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyBaseUrlOnlyTest.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyBaseUrlOnlyTest.java @@ -111,7 +111,6 @@ void testSuccessfulRequest() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.HTTP_METHOD, "GET"), equalTo(SemanticAttributes.HTTP_URL, uri + "/"), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, USER_AGENT), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200), equalTo(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, 0), satisfies( diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyClientSslTest.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyClientSslTest.java index 1e7e805e19b4..16aeb4a4617f 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyClientSslTest.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyClientSslTest.java @@ -188,7 +188,6 @@ void shouldSuccessfullyEstablishSslHandshake() throws SSLException { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.HTTP_METHOD, "GET"), equalTo(SemanticAttributes.HTTP_URL, uri), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, USER_AGENT), equalTo(SemanticAttributes.NET_PROTOCOL_NAME, "http"), equalTo(SemanticAttributes.NET_PROTOCOL_VERSION, "1.1"), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200), diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyConnectionSpanTest.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyConnectionSpanTest.java index 7fbf042310d7..96aecc5b2847 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyConnectionSpanTest.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyConnectionSpanTest.java @@ -102,7 +102,6 @@ void testSuccessfulRequest() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.HTTP_METHOD, "GET"), equalTo(SemanticAttributes.HTTP_URL, uri), - equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, USER_AGENT), equalTo(SemanticAttributes.NET_PROTOCOL_NAME, "http"), equalTo(SemanticAttributes.NET_PROTOCOL_VERSION, "1.1"), equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200),