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

[HTTP Metrics] Rename server.socket.address to network.peer.address #92956

Closed
antonfirsov opened this issue Oct 3, 2023 · 4 comments
Closed
Assignees
Milestone

Comments

@antonfirsov
Copy link
Member

antonfirsov commented Oct 3, 2023

open-telemetry/semantic-conventions#342 is introducing changes to the OTel standard that will effect the conformance of our http.client.open_connections and http.client.connection.duration metrics. The PR is expected to be merged very soon giving us an opportunity to adjust our metrics for 8.0 GA and avoid breaking changes in 9.0.

_connectionMetrics = new ConnectionMetrics(
metrics,
protocol,
pool.IsSecure ? "https" : "http",
pool.OriginAuthority.HostValue,
pool.IsDefaultPort ? null : pool.OriginAuthority.Port,
remoteEndPoint?.Address?.ToString());

@antonfirsov antonfirsov added this to the 8.0.0 milestone Oct 3, 2023
@ghost
Copy link

ghost commented Oct 3, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

open-telemetry/semantic-conventions#342 is introducing changes to the OTel standard that will effect the conformance of attributes in our http.client.open_connections and http.client.connection.duration metrics. The PR is expected to be merged very soon giving us an opportunity to adjust our metrics and avoid breaking changes in 9.0.

_connectionMetrics = new ConnectionMetrics(
metrics,
protocol,
pool.IsSecure ? "https" : "http",
pool.OriginAuthority.HostValue,
pool.IsDefaultPort ? null : pool.OriginAuthority.Port,
remoteEndPoint?.Address?.ToString());

Author: antonfirsov
Assignees: -
Labels:

area-System.Net.Http

Milestone: 8.0.0

@antonfirsov
Copy link
Member Author

@lmolkova please confirm if my understanding of the required changes is correct.

@antonfirsov antonfirsov self-assigned this Oct 3, 2023
@antonfirsov
Copy link
Member Author

antonfirsov commented Oct 9, 2023

After further consideration, I prefer to not implement network.peer.address:

  • Always including it would lead to a boxing allocation every time we record a connection metric, which I assume we want to avoid.
  • We could choose to only include it with non-default ports (just like we do it with server.port), but determining that requires non-trivial logic, and such an approach seems to be against the recommendation of the standard in its' current form. This may change with discussions (see Rename/replace (client|server).socket.(address|port) attributes with network.(peer|local).(address|port). open-telemetry/semantic-conventions#342 (comment)), but it is too late to consider adapting to such changes.
  • The information is not of a critical value to users: when there is no proxy, network.peer.address should be equal to server.port. When there is a proxy, the port can be determined from sources other than metrics.
  • It is very late in the release cycle, we should keep changes as simple and as low risk as possible.

@antonfirsov antonfirsov changed the title Rename server.socket.address to network.peer.address and add network.peer.port [HTTP Metrics] Rename server.socket.address to network.peer.address Oct 9, 2023
@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Oct 12, 2023
@antonfirsov
Copy link
Member Author

antonfirsov commented Oct 16, 2023

Fixed by #93414 in release/8.0, and by #93255 in main (9.0).

@ghost ghost locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant