Skip to content

Commit

Permalink
Fix triggering of DNS lookup (open-telemetry#5297)
Browse files Browse the repository at this point in the history
* Fix triggering of DNS lookup

* Update test

* Update test
  • Loading branch information
trask authored and RashmiRam committed May 23, 2022
1 parent c7e68e0 commit e7c6a14
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e7c6a14

Please sign in to comment.