From 44c9e910486990039d45eb9f9f4abfb00370d305 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 17 Feb 2022 12:07:00 -0800 Subject: [PATCH] Update tests to verify NET_PEER_NAME is never captured for http server spans --- .../instrumentation/test/base/HttpServerTest.groovy | 9 --------- 1 file changed, 9 deletions(-) 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 11f23f7d64..bb782730a3 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) } }