Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix triggering of reverse name lookup #5297

Merged
merged 3 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe getHostString may return ip address. I hope spec is ok with this, if it isn't I guess we could compare it with getHostAddress and return null in case they match.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

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