diff --git a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java index 7975aa8630fb..019df5343b14 100644 --- a/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java +++ b/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java @@ -29,9 +29,6 @@ public final String peerName(REQUEST request, @Nullable RESPONSE response) { if (address == null) { return null; } - if (address.getAddress() != null) { - return address.getAddress().getHostName(); - } return address.getHostString(); } 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 92a286f37b5c..269286a9ee6d 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 @@ -29,9 +29,6 @@ public final String peerName(REQUEST request) { if (address == null) { return null; } - if (address.getAddress() != null) { - return address.getAddress().getHostName(); - } return address.getHostString(); } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/test/groovy/Elasticsearch6TransportClientTest.groovy b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/test/groovy/Elasticsearch6TransportClientTest.groovy index 3fc76707ef40..26b182e3b3b1 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/test/groovy/Elasticsearch6TransportClientTest.groovy +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/test/groovy/Elasticsearch6TransportClientTest.groovy @@ -105,7 +105,6 @@ class Elasticsearch6TransportClientTest extends AbstractElasticsearchTransportCl kind CLIENT childOf(span(0)) attributes { - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_IP" tcpPublishAddress.address "$SemanticAttributes.NET_PEER_PORT" tcpPublishAddress.port "$SemanticAttributes.DB_SYSTEM" "elasticsearch" @@ -224,7 +223,6 @@ class Elasticsearch6TransportClientTest extends AbstractElasticsearchTransportCl name "CreateIndexAction" kind CLIENT attributes { - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_IP" tcpPublishAddress.address "$SemanticAttributes.NET_PEER_PORT" tcpPublishAddress.port "$SemanticAttributes.DB_SYSTEM" "elasticsearch" @@ -240,7 +238,6 @@ class Elasticsearch6TransportClientTest extends AbstractElasticsearchTransportCl name "GetAction" kind CLIENT attributes { - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_IP" tcpPublishAddress.address "$SemanticAttributes.NET_PEER_PORT" tcpPublishAddress.port "$SemanticAttributes.DB_SYSTEM" "elasticsearch" @@ -271,7 +268,6 @@ class Elasticsearch6TransportClientTest extends AbstractElasticsearchTransportCl name "IndexAction" kind CLIENT attributes { - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_IP" tcpPublishAddress.address "$SemanticAttributes.NET_PEER_PORT" tcpPublishAddress.port "$SemanticAttributes.DB_SYSTEM" "elasticsearch" @@ -293,7 +289,6 @@ class Elasticsearch6TransportClientTest extends AbstractElasticsearchTransportCl name "GetAction" kind CLIENT attributes { - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_IP" tcpPublishAddress.address "$SemanticAttributes.NET_PEER_PORT" tcpPublishAddress.port "$SemanticAttributes.DB_SYSTEM" "elasticsearch" diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/test/groovy/Jedis40ClientTest.groovy b/instrumentation/jedis/jedis-4.0/javaagent/src/test/groovy/Jedis40ClientTest.groovy index bbcdce5b9f61..585f548b7d71 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/test/groovy/Jedis40ClientTest.groovy +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/test/groovy/Jedis40ClientTest.groovy @@ -24,7 +24,7 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { def setupSpec() { redisServer.start() port = redisServer.getMappedPort(6379) - jedis = new Jedis("localhost", port) + jedis = new Jedis("127.0.0.1", port) } def cleanupSpec() { @@ -51,7 +51,6 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM" "redis" "$SemanticAttributes.DB_STATEMENT" "SET foo ?" "$SemanticAttributes.DB_OPERATION" "SET" - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_PORT" port "$SemanticAttributes.NET_PEER_IP" "127.0.0.1" "$SemanticAttributes.NET_TRANSPORT" SemanticAttributes.NetTransportValues.IP_TCP @@ -78,7 +77,6 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM" "redis" "$SemanticAttributes.DB_STATEMENT" "SET foo ?" "$SemanticAttributes.DB_OPERATION" "SET" - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_PORT" port "$SemanticAttributes.NET_PEER_IP" "127.0.0.1" "$SemanticAttributes.NET_TRANSPORT" SemanticAttributes.NetTransportValues.IP_TCP @@ -93,7 +91,6 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM" "redis" "$SemanticAttributes.DB_STATEMENT" "GET foo" "$SemanticAttributes.DB_OPERATION" "GET" - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_PORT" port "$SemanticAttributes.NET_PEER_IP" "127.0.0.1" "$SemanticAttributes.NET_TRANSPORT" SemanticAttributes.NetTransportValues.IP_TCP @@ -120,7 +117,6 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM" "redis" "$SemanticAttributes.DB_STATEMENT" "SET foo ?" "$SemanticAttributes.DB_OPERATION" "SET" - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_PORT" port "$SemanticAttributes.NET_PEER_IP" "127.0.0.1" "$SemanticAttributes.NET_TRANSPORT" SemanticAttributes.NetTransportValues.IP_TCP @@ -135,7 +131,6 @@ class Jedis40ClientTest extends AgentInstrumentationSpecification { "$SemanticAttributes.DB_SYSTEM" "redis" "$SemanticAttributes.DB_STATEMENT" "RANDOMKEY" "$SemanticAttributes.DB_OPERATION" "RANDOMKEY" - "$SemanticAttributes.NET_PEER_NAME" "localhost" "$SemanticAttributes.NET_PEER_PORT" port "$SemanticAttributes.NET_PEER_IP" "127.0.0.1" "$SemanticAttributes.NET_TRANSPORT" SemanticAttributes.NetTransportValues.IP_TCP