From 705d80ef3ee9fa04e39b89fd199e182e71180372 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 17 Feb 2022 15:41:37 -0800 Subject: [PATCH 1/2] Fix server -> client reference --- .../spring/web/SpringWebNetAttributesGetter.java | 14 ++++++++------ .../spring/web/SpringWebTracingBuilder.java | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebNetAttributesGetter.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebNetAttributesGetter.java index 25e078792425..e3f49cb78cdf 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebNetAttributesGetter.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebNetAttributesGetter.java @@ -5,31 +5,33 @@ package io.opentelemetry.instrumentation.spring.web; -import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; import javax.annotation.Nullable; import org.springframework.http.HttpRequest; +import org.springframework.http.client.ClientHttpResponse; -final class SpringWebNetAttributesGetter implements NetServerAttributesGetter { +final class SpringWebNetAttributesGetter + implements NetClientAttributesGetter { @Override - public String transport(HttpRequest httpRequest) { + public String transport(HttpRequest httpRequest, @Nullable ClientHttpResponse response) { return SemanticAttributes.NetTransportValues.IP_TCP; } @Override @Nullable - public String peerName(HttpRequest httpRequest) { + public String peerName(HttpRequest httpRequest, @Nullable ClientHttpResponse response) { return httpRequest.getURI().getHost(); } @Override - public Integer peerPort(HttpRequest httpRequest) { + public Integer peerPort(HttpRequest httpRequest, @Nullable ClientHttpResponse response) { return httpRequest.getURI().getPort(); } @Override @Nullable - public String peerIp(HttpRequest httpRequest) { + public String peerIp(HttpRequest httpRequest, @Nullable ClientHttpResponse response) { return null; } } diff --git a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java index d94200e159f4..e128dbe24540 100644 --- a/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java +++ b/instrumentation/spring/spring-web-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/web/SpringWebTracingBuilder.java @@ -14,7 +14,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientMetrics; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; -import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesExtractor; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesExtractor; import java.util.ArrayList; import java.util.List; import org.springframework.http.HttpRequest; @@ -71,7 +71,7 @@ public SpringWebTracing build() { .setSpanStatusExtractor(HttpSpanStatusExtractor.create(httpAttributeGetter)) .addAttributesExtractor( HttpClientAttributesExtractor.create(httpAttributeGetter, capturedHttpHeaders)) - .addAttributesExtractor(NetServerAttributesExtractor.create(netAttributesGetter)) + .addAttributesExtractor(NetClientAttributesExtractor.create(netAttributesGetter)) .addAttributesExtractors(additionalExtractors) .addRequestMetrics(HttpClientMetrics.get()) .newClientInstrumenter(HttpRequestSetter.INSTANCE); From 73c431f48b635cd93c3b810a37d8e04fa0ee48d7 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 18 Feb 2022 09:29:43 -0800 Subject: [PATCH 2/2] Remove server span peer name --- .../InetSocketAddressNetServerAttributesGetter.java | 10 ---------- .../instrumenter/net/NetServerAttributesExtractor.java | 4 ---- .../instrumenter/net/NetServerAttributesGetter.java | 5 +---- .../api/instrumenter/InstrumenterTest.java | 5 ----- ...InetSocketAddressNetServerAttributesGetterTest.java | 2 -- .../net/NetServerAttributesExtractorTest.java | 6 ------ .../grizzly/GrizzlyNetAttributesGetter.java | 6 ------ .../ktor/v1_0/KtorNetServerAttributesGetter.kt | 9 --------- .../internal/channel/HttpDispatcherLink.java | 4 ---- .../LibertyDispatcherNetAttributesGetter.java | 6 ------ .../liberty/dispatcher/LibertyRequest.java | 4 ---- .../ratpack/internal/RatpackNetAttributesGetter.java | 7 ------- .../restlet/v1_0/RestletNetAttributesGetter.java | 6 ------ .../v2_0/internal/RestletNetAttributesGetter.java | 6 ------ .../instrumentation/servlet/v5_0/Servlet5Accessor.java | 5 ----- .../instrumentation/servlet/ServletAccessor.java | 2 -- .../servlet/ServletNetAttributesGetter.java | 6 ------ .../servlet/javax/JavaxServletAccessor.java | 5 ----- .../spring/webmvc/SpringWebMvcNetAttributesGetter.java | 6 ------ .../tomcat/common/TomcatNetAttributesGetter.java | 8 -------- .../instrumentation/test/base/HttpServerTest.groovy | 9 --------- 21 files changed, 1 insertion(+), 120 deletions(-) diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetter.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetter.java index 269286a9ee6d..eb0d22a4b19b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetter.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetter.java @@ -22,16 +22,6 @@ public abstract class InetSocketAddressNetServerAttributesGetter @Nullable public abstract InetSocketAddress getAddress(REQUEST request); - @Override - @Nullable - public final String peerName(REQUEST request) { - InetSocketAddress address = getAddress(request); - if (address == null) { - return null; - } - return address.getHostString(); - } - @Override @Nullable public final Integer peerPort(REQUEST request) { diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java index f2945290c560..1e416a250d51 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractor.java @@ -36,11 +36,7 @@ public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST set(attributes, SemanticAttributes.NET_TRANSPORT, getter.transport(request)); String peerIp = getter.peerIp(request); - String peerName = getter.peerName(request); - if (peerName != null && !peerName.equals(peerIp)) { - set(attributes, SemanticAttributes.NET_PEER_NAME, peerName); - } set(attributes, SemanticAttributes.NET_PEER_IP, peerIp); Integer peerPort = getter.peerPort(request); diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java index 9b648cb1968e..31d1edea002b 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesGetter.java @@ -9,7 +9,7 @@ /** * An interface for getting server-based network attributes. It adapts a vendor-specific request - * type into the 4 common attributes (transport, peerName, peerPort, peerIp). + * type into the 3 common attributes (transport, peerPort, peerIp). * *

Instrumentation authors will create implementations of this interface for their specific * server library/framework. It will be used by the {@link NetServerAttributesExtractor} to obtain @@ -20,9 +20,6 @@ public interface NetServerAttributesGetter { @Nullable String transport(REQUEST request); - @Nullable - String peerName(REQUEST request); - @Nullable Integer peerPort(REQUEST request); diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java index 228532b03488..36fffa955379 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterTest.java @@ -784,11 +784,6 @@ public String transport(REQUEST request) { return null; } - @Override - public String peerName(REQUEST request) { - return null; - } - @Override public Integer peerPort(REQUEST request) { return null; diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java index 9515dde3f03f..b292012b6b3f 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetServerAttributesGetterTest.java @@ -66,7 +66,6 @@ void fullAddress() { .containsOnly( entry(SemanticAttributes.NET_TRANSPORT, SemanticAttributes.NetTransportValues.IP_TCP), entry(SemanticAttributes.NET_PEER_IP, request.getAddress().getHostAddress()), - entry(SemanticAttributes.NET_PEER_NAME, "github.com"), entry(SemanticAttributes.NET_PEER_PORT, 123L)); assertThat(endAttributes.build()).isEmpty(); @@ -94,7 +93,6 @@ void unresolved() { assertThat(startAttributes.build()) .containsOnly( entry(SemanticAttributes.NET_TRANSPORT, SemanticAttributes.NetTransportValues.IP_TCP), - entry(SemanticAttributes.NET_PEER_NAME, "github.com"), entry(SemanticAttributes.NET_PEER_PORT, 123L)); assertThat(endAttributes.build()).isEmpty(); diff --git a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java index c63ffa609dfe..79504e93dac8 100644 --- a/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java +++ b/instrumentation-api/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetServerAttributesExtractorTest.java @@ -26,11 +26,6 @@ public String transport(Map request) { return request.get("transport"); } - @Override - public String peerName(Map request) { - return request.get("peerName"); - } - @Override public Integer peerPort(Map request) { return Integer.valueOf(request.get("peerPort")); @@ -72,7 +67,6 @@ void normal() { assertThat(startAttributes.build()) .containsOnly( entry(SemanticAttributes.NET_TRANSPORT, "TCP"), - entry(SemanticAttributes.NET_PEER_NAME, "github.com"), entry(SemanticAttributes.NET_PEER_PORT, 123L), entry(SemanticAttributes.NET_PEER_IP, "1.2.3.4")); diff --git a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyNetAttributesGetter.java b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyNetAttributesGetter.java index ea4f161b7b06..12c5014e93a8 100644 --- a/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyNetAttributesGetter.java +++ b/instrumentation/grizzly-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/grizzly/GrizzlyNetAttributesGetter.java @@ -17,12 +17,6 @@ public String transport(HttpRequestPacket request) { return null; } - @Nullable - @Override - public String peerName(HttpRequestPacket request) { - return request.getRemoteHost(); - } - @Override public Integer peerPort(HttpRequestPacket request) { return request.getRemotePort(); diff --git a/instrumentation/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorNetServerAttributesGetter.kt b/instrumentation/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorNetServerAttributesGetter.kt index eb3c10c10768..74e80ac2eceb 100644 --- a/instrumentation/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorNetServerAttributesGetter.kt +++ b/instrumentation/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorNetServerAttributesGetter.kt @@ -6,7 +6,6 @@ package io.opentelemetry.instrumentation.ktor.v1_0 import io.ktor.request.* -import io.ktor.response.* import io.opentelemetry.instrumentation.api.instrumenter.net.NetServerAttributesGetter import io.opentelemetry.semconv.trace.attributes.SemanticAttributes @@ -15,14 +14,6 @@ internal class KtorNetServerAttributesGetter : NetServerAttributesGetter { @Override - @Nullable public String transport(Request request) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(Request request) { - return null; - } - @Override public Integer peerPort(Request request) { return request.getRemoteAddress().getPort(); diff --git a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletNetAttributesGetter.java b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletNetAttributesGetter.java index 9dd1b6636425..e3ff56cdb7a3 100644 --- a/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletNetAttributesGetter.java +++ b/instrumentation/restlet/restlet-1.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v1_0/RestletNetAttributesGetter.java @@ -16,12 +16,6 @@ public String transport(Request request) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(Request request) { - return null; - } - @Override public Integer peerPort(Request request) { return request.getClientInfo().getPort(); diff --git a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletNetAttributesGetter.java b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletNetAttributesGetter.java index 98ac510861b5..a2918dc9558e 100644 --- a/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletNetAttributesGetter.java +++ b/instrumentation/restlet/restlet-2.0/library/src/main/java/io/opentelemetry/instrumentation/restlet/v2_0/internal/RestletNetAttributesGetter.java @@ -16,12 +16,6 @@ public String transport(Request request) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(Request request) { - return null; - } - @Override public Integer peerPort(Request request) { return request.getClientInfo().getPort(); diff --git a/instrumentation/servlet/servlet-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/v5_0/Servlet5Accessor.java b/instrumentation/servlet/servlet-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/v5_0/Servlet5Accessor.java index dc1a3a47d070..2109e0fe2404 100644 --- a/instrumentation/servlet/servlet-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/v5_0/Servlet5Accessor.java +++ b/instrumentation/servlet/servlet-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/v5_0/Servlet5Accessor.java @@ -123,11 +123,6 @@ public Integer getRequestRemotePort(HttpServletRequest request) { return request.getRemotePort(); } - @Override - public String getRequestRemoteHost(HttpServletRequest request) { - return request.getRemoteHost(); - } - @Override public int getRequestContentLength(HttpServletRequest request) { return request.getContentLength(); diff --git a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletAccessor.java b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletAccessor.java index e39a08afebdc..056b70a1e98a 100644 --- a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletAccessor.java +++ b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletAccessor.java @@ -57,8 +57,6 @@ public interface ServletAccessor { Integer getRequestRemotePort(REQUEST request); - String getRequestRemoteHost(REQUEST request); - int getRequestContentLength(REQUEST request); void addRequestAsyncListener( diff --git a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletNetAttributesGetter.java b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletNetAttributesGetter.java index 6016367a0508..08954e4d3396 100644 --- a/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletNetAttributesGetter.java +++ b/instrumentation/servlet/servlet-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/ServletNetAttributesGetter.java @@ -23,12 +23,6 @@ public String transport(ServletRequestContext requestContext) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(ServletRequestContext requestContext) { - return accessor.getRequestRemoteHost(requestContext.request()); - } - @Override @Nullable public Integer peerPort(ServletRequestContext requestContext) { diff --git a/instrumentation/servlet/servlet-javax-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/javax/JavaxServletAccessor.java b/instrumentation/servlet/servlet-javax-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/javax/JavaxServletAccessor.java index 081113d8a716..b37c17f326a8 100644 --- a/instrumentation/servlet/servlet-javax-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/javax/JavaxServletAccessor.java +++ b/instrumentation/servlet/servlet-javax-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/servlet/javax/JavaxServletAccessor.java @@ -70,11 +70,6 @@ public String getRequestRemoteAddr(HttpServletRequest request) { return request.getRemoteAddr(); } - @Override - public String getRequestRemoteHost(HttpServletRequest httpServletRequest) { - return httpServletRequest.getRemoteHost(); - } - @Override public String getRequestHeader(HttpServletRequest request, String name) { return request.getHeader(name); diff --git a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcNetAttributesGetter.java b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcNetAttributesGetter.java index ff4a31b85a04..0d41652a0563 100644 --- a/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcNetAttributesGetter.java +++ b/instrumentation/spring/spring-webmvc-3.1/library/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/SpringWebMvcNetAttributesGetter.java @@ -17,12 +17,6 @@ public String transport(HttpServletRequest request) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(HttpServletRequest request) { - return request.getRemoteHost(); - } - @Override public Integer peerPort(HttpServletRequest request) { return request.getRemotePort(); diff --git a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatNetAttributesGetter.java b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatNetAttributesGetter.java index 469cf667b3a5..0ac80ec45ad9 100644 --- a/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatNetAttributesGetter.java +++ b/instrumentation/tomcat/tomcat-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/tomcat/common/TomcatNetAttributesGetter.java @@ -19,14 +19,6 @@ public String transport(Request request) { return SemanticAttributes.NetTransportValues.IP_TCP; } - @Override - @Nullable - public String peerName(Request request) { - // not using request.action(ActionCode.REQ_HOST_ATTRIBUTE, request) since that calls - // InetAddress.getHostName() which trigger reverse name lookup - return null; - } - @Override @Nullable public Integer peerPort(Request request) { diff --git a/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy b/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy index 21b5f587a9f5..8db8be056b77 100644 --- a/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy +++ b/testing-common/src/main/groovy/io/opentelemetry/instrumentation/test/base/HttpServerTest.groovy @@ -167,7 +167,6 @@ abstract class HttpServerTest extends InstrumentationSpecification imple [ SemanticAttributes.HTTP_ROUTE, SemanticAttributes.NET_TRANSPORT, - SemanticAttributes.NET_PEER_NAME, SemanticAttributes.NET_PEER_PORT ] as Set } @@ -695,10 +694,6 @@ abstract class HttpServerTest extends InstrumentationSpecification imple if (httpAttributes.contains(SemanticAttributes.NET_TRANSPORT)) { "$SemanticAttributes.NET_TRANSPORT" IP_TCP } - if (httpAttributes.contains(SemanticAttributes.NET_PEER_NAME)) { - // net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured - "$SemanticAttributes.NET_PEER_NAME" { it == null || it == address.host } - } if (httpAttributes.contains(SemanticAttributes.NET_PEER_PORT)) { "$SemanticAttributes.NET_PEER_PORT" { (it instanceof Long && it.intValue() != port) } } @@ -760,10 +755,6 @@ abstract class HttpServerTest extends InstrumentationSpecification imple if (httpAttributes.contains(SemanticAttributes.NET_TRANSPORT)) { "$SemanticAttributes.NET_TRANSPORT" IP_TCP } - if (httpAttributes.contains(SemanticAttributes.NET_PEER_NAME)) { - // net.peer.name resolves to "127.0.0.1" on windows which is same as net.peer.ip so then not captured - "$SemanticAttributes.NET_PEER_NAME" { it == null || it == address.host } - } if (httpAttributes.contains(SemanticAttributes.NET_PEER_PORT)) { "$SemanticAttributes.NET_PEER_PORT" { (it instanceof Long && it.intValue() != port) } }