Revert "[HTTP] Remove peer.address from connection OTel counters"#129317
Revert "[HTTP] Remove peer.address from connection OTel counters"#129317ManickaP wants to merge 1 commit into
Conversation
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
🤖 Copilot Code Review — PR #129317Note This review was AI-generated by GitHub Copilot. Holistic AssessmentMotivation: Well-justified revert. PR #128940 removed Approach: Clean Summary: ✅ LGTM. This is a straightforward, clean revert that restores Detailed Findings✅ Correctness — Revert is complete and faithfulThe revert touches exactly the three files modified in #128940:
The single callsite ( ✅ Test quality — Restored tests are sound
💡 Minor observation — Nullable annotation style (non-blocking)
|
There was a problem hiding this comment.
Pull request overview
This PR reverts a prior change that removed the network.peer.address tag from System.Net.Http connection-level OpenTelemetry metrics by restoring the tag emission in SocketsHttpHandler and re-updating functional tests to expect/validate it.
Changes:
- Restore emission of
network.peer.addresson connection metrics (http.client.open_connections,http.client.connection.duration) when a remote endpoint address is available. - Update functional metrics tests to validate
network.peer.address, including external-server coverage by allowing any resolved IP for the host.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs | Adds peer-address validation helpers and updates external-server test to accept any resolved peer IP. |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/ConnectionMetrics.cs | Reintroduces the network.peer.address tag (conditionally) in the tag set used for connection metrics. |
| src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionBase.cs | Plumbs the remote endpoint address string into ConnectionMetrics at connection establishment. |
| // This flakes for remote requests on CI. | ||
| if (validPeerAddresses is null) | ||
| { | ||
| Assert.InRange(value, double.Epsilon, 60); | ||
| } |
Reverts #128940
Apparently, there are 2 different specs, and the one for .NET is stable. See discussion in #128940 (comment)