Add comment and consistency.

This commit is contained in:
Tyler Benson 2019-04-29 12:08:49 -07:00
parent 6414de82d9
commit 54287fa548
2 changed files with 4 additions and 1 deletions

View File

@ -68,6 +68,7 @@ public abstract class HttpClientDecorator<REQUEST, RESPONSE> extends ClientDecor
Tags.PEER_HOSTNAME.set(span, hostname(request));
final Integer port = port(request);
// Negative or Zero ports might represent an unset/null value for an int type. Skip setting.
Tags.PEER_PORT.set(span, port != null && port > 0 ? port : null);
if (Config.get().isHttpClientSplitByDomain()) {

View File

@ -88,7 +88,9 @@ public abstract class HttpServerDecorator<REQUEST, CONNECTION, RESPONSE> extends
Tags.PEER_HOST_IPV6.set(span, ip);
}
}
Tags.PEER_PORT.set(span, peerPort(connection));
final Integer port = peerPort(connection);
// Negative or Zero ports might represent an unset/null value for an int type. Skip setting.
Tags.PEER_PORT.set(span, port != null && port > 0 ? port : null);
}
return span;
}