[Breaking change]: HttpClient Metrics reporting server.port
unconditionally
#42810
Closed
1 of 3 tasks
Labels
breaking-change
Indicates a .NET Core breaking change
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
in-pr
This issue will be closed (fixed) by an active pull request.
Pri1
High priority, do before Pri2 and Pri3
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Description
When implementing HttpClient Metrics in .NET 8,
server.port
was introduced as a Conditionally Required attribute in accordance with the state of the standard at that time, meaning that the port was only reported if it did not match the default port of the corresponding protocol (80 for HTTP, 443 for HTTPS). However, the standard requirement level of the attribute has been changed later to Required.To maintain compliance with the Open Telemetry standard while keeping the instrument's behaviors consistent with each other, the instruments
http.client.request.duration
,http.client.connection.duration
andhttp.client.open_connections
have been changed to unconditionally report theserver.port
attribute.This may break existing queries in monitoring software like Prometheus.
Version
.NET 9 Preview 7
Previous behavior
http.client.request.duration
,http.client.connection.duration
andhttp.client.open_connections
reported theserver.port
attribute only if it did not match the corresponding protocol's default port (80 for HTTP, 443 for HTTPS).New behavior
dotnet/runtime#104741 has changed the previos behavior so the
server.port
attribute is unconditionally reported by the instrumentshttp.client.request.duration
,http.client.connection.duration
andhttp.client.open_connections
.Type of breaking change
Reason for change
Maintaining compliance with the corresponding Open Telemetry specification, while keeping HttpClient instruments consistent with each other.
Recommended action
No action is needed for users who do not rely on HttpClient Metrics.
For users of the
http.client.request.duration
,http.client.connection.duration
andhttp.client.open_connections
instruments, the change may break existing queries in monitoring software like Prometheus.Feature area
Core .NET libraries, Networking
Affected APIs
System.Net.Http.SocketsHttpHandler.Send(...)
System.Net.Http.SocketsHttpHandler.SendAsync(...)
System.Net.Http.HttpClientHandler.Send(...)
System.Net.Http.HttpClientHandler.SendAsync(...)
Associated WorkItem - 340215
The text was updated successfully, but these errors were encountered: