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

Remove server.{address,port} from HTTP server metrics #8771

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 @@ -39,8 +39,6 @@ private static Set<AttributeKey> buildDurationAlwaysInclude() {
view.add(HttpAttributes.HTTP_RESPONSE_STATUS_CODE);
view.add(NetworkAttributes.NETWORK_PROTOCOL_NAME);
view.add(NetworkAttributes.NETWORK_PROTOCOL_VERSION);
view.add(NetworkAttributes.SERVER_ADDRESS);
view.add(NetworkAttributes.SERVER_PORT);
return view;
}

Expand All @@ -54,6 +52,8 @@ private static Set<AttributeKey> buildDurationClientView() {
view.add(SemanticAttributes.NET_SOCK_PEER_ADDR);
// stable semconv
view.add(NetworkAttributes.SERVER_SOCKET_ADDRESS);
view.add(NetworkAttributes.SERVER_ADDRESS);
view.add(NetworkAttributes.SERVER_PORT);
return view;
}

Expand Down Expand Up @@ -83,8 +83,6 @@ private static Set<AttributeKey> buildActiveRequestsView() {
view.add(SemanticAttributes.NET_HOST_PORT);
// stable semconv
view.add(HttpAttributes.HTTP_REQUEST_METHOD);
view.add(NetworkAttributes.SERVER_ADDRESS);
view.add(NetworkAttributes.SERVER_PORT);
view.add(UrlAttributes.URL_SCHEME);
return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ void shouldApplyServerDurationAndSizeView_stableSemconv() {
entry(SemanticAttributes.HTTP_ROUTE, "/somehost/high/{name}/{id}"),
entry(UrlAttributes.URL_SCHEME, "https"),
entry(NetworkAttributes.NETWORK_PROTOCOL_NAME, "http"),
entry(NetworkAttributes.NETWORK_PROTOCOL_VERSION, "1.1"),
entry(NetworkAttributes.SERVER_ADDRESS, "somehost"),
entry(NetworkAttributes.SERVER_PORT, 443L));
entry(NetworkAttributes.NETWORK_PROTOCOL_VERSION, "1.1"));
}

@Test
Expand Down Expand Up @@ -234,8 +232,6 @@ void shouldApplyActiveRequestsView_stableSemconv() {
assertThat(applyActiveRequestsView(attributes))
.containsOnly(
entry(HttpAttributes.HTTP_REQUEST_METHOD, "GET"),
entry(UrlAttributes.URL_SCHEME, "https"),
entry(NetworkAttributes.SERVER_ADDRESS, "somehost"),
entry(NetworkAttributes.SERVER_PORT, 443L));
entry(UrlAttributes.URL_SCHEME, "https"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ void collectsMetrics() {
.hasValue(1)
.hasAttributesSatisfying(
equalTo(HttpAttributes.HTTP_REQUEST_METHOD, "GET"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -118,9 +116,7 @@ void collectsMetrics() {
.hasValue(2)
.hasAttributesSatisfying(
equalTo(HttpAttributes.HTTP_REQUEST_METHOD, "GET"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -142,9 +138,7 @@ void collectsMetrics() {
.hasValue(1)
.hasAttributesSatisfying(
equalTo(HttpAttributes.HTTP_REQUEST_METHOD, "GET"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -167,9 +161,7 @@ void collectsMetrics() {
NetworkAttributes.NETWORK_PROTOCOL_NAME, "http"),
equalTo(
NetworkAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -193,9 +185,7 @@ void collectsMetrics() {
NetworkAttributes.NETWORK_PROTOCOL_NAME, "http"),
equalTo(
NetworkAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand All @@ -218,9 +208,7 @@ void collectsMetrics() {
NetworkAttributes.NETWORK_PROTOCOL_NAME, "http"),
equalTo(
NetworkAttributes.NETWORK_PROTOCOL_VERSION, "2.0"),
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "localhost"),
equalTo(NetworkAttributes.SERVER_PORT, 1234L))
equalTo(UrlAttributes.URL_SCHEME, "https"))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand Down Expand Up @@ -328,7 +316,6 @@ void collectsHttpRouteFromEndAttributes() {
.hasSum(0.100 /* seconds */)
.hasAttributesSatisfying(
equalTo(UrlAttributes.URL_SCHEME, "https"),
equalTo(NetworkAttributes.SERVER_ADDRESS, "host"),
equalTo(
SemanticAttributes.HTTP_ROUTE, "/test/{id}")))));
}
Expand Down
Loading