Skip to content

Commit

Permalink
Remove server.socket.address from HTTP/RPC metrics (#9633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Oct 9, 2023
1 parent ab66a85 commit 6e79eb0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ static void applyStableClientDurationAdvice(DoubleHistogramBuilder builder) {
SemanticAttributes.NETWORK_PROTOCOL_NAME,
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS));
SemanticAttributes.SERVER_PORT));
}

@SuppressWarnings("deprecation") // until old http semconv are dropped in 2.0
Expand Down Expand Up @@ -65,7 +64,6 @@ static void applyClientRequestSizeAdvice(LongHistogramBuilder builder) {
SemanticAttributes.NETWORK_PROTOCOL_VERSION,
SemanticAttributes.SERVER_ADDRESS,
SemanticAttributes.SERVER_PORT,
SemanticAttributes.SERVER_SOCKET_ADDRESS,
// old attributes
SemanticAttributes.HTTP_METHOD,
SemanticAttributes.HTTP_STATUS_CODE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ static void applyClientDurationAdvice(DoubleHistogramBuilder builder) {
attributes.add(SemanticAttributes.NETWORK_TRANSPORT);
attributes.add(SemanticAttributes.SERVER_ADDRESS);
attributes.add(SemanticAttributes.SERVER_PORT);
attributes.add(SemanticAttributes.SERVER_SOCKET_ADDRESS);
attributes.add(SemanticAttributes.SERVER_SOCKET_PORT);
}
if (SemconvStability.emitOldHttpSemconv()) {
attributes.add(SemanticAttributes.NET_PEER_NAME);
Expand Down Expand Up @@ -65,8 +63,6 @@ static void applyServerDurationAdvice(DoubleHistogramBuilder builder) {
attributes.add(SemanticAttributes.NETWORK_TRANSPORT);
attributes.add(SemanticAttributes.SERVER_ADDRESS);
attributes.add(SemanticAttributes.SERVER_PORT);
attributes.add(SemanticAttributes.SERVER_SOCKET_ADDRESS);
attributes.add(SemanticAttributes.SERVER_SOCKET_PORT);
}
if (SemconvStability.emitOldHttpSemconv()) {
attributes.add(SemanticAttributes.NET_HOST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ void collectsMetrics() {
equalTo(
SemanticAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(SemanticAttributes.SERVER_ADDRESS, "localhost"),
equalTo(SemanticAttributes.SERVER_PORT, 1234),
equalTo(
SemanticAttributes.SERVER_SOCKET_ADDRESS,
"1.2.3.4"))
equalTo(SemanticAttributes.SERVER_PORT, 1234))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -126,10 +123,7 @@ void collectsMetrics() {
equalTo(
SemanticAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(SemanticAttributes.SERVER_ADDRESS, "localhost"),
equalTo(SemanticAttributes.SERVER_PORT, 1234),
equalTo(
SemanticAttributes.SERVER_SOCKET_ADDRESS,
"1.2.3.4"))
equalTo(SemanticAttributes.SERVER_PORT, 1234))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ void collectsMetrics() {
equalTo(
SemanticAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(SemanticAttributes.SERVER_ADDRESS, "localhost"),
equalTo(SemanticAttributes.SERVER_PORT, 1234),
equalTo(
SemanticAttributes.SERVER_SOCKET_ADDRESS,
"1.2.3.4"))
equalTo(SemanticAttributes.SERVER_PORT, 1234))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand Down

0 comments on commit 6e79eb0

Please sign in to comment.