You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.NET 9 introduced additions to `System.Net` distributed tracing which define a contract following OTel recommendations:
- dotnet/runtime#104251 adjusted the HTTP client request activity so it natively complies with OTel recommendations. This included adding standard tags.
- dotnet/runtime#103922 introduced activities breaking down the HTTP connection setup.
This PR documents the activities together with their attributes in a manner similar to the metrics docs added by #37213. The matching semconv PR is open-telemetry/semantic-conventions#1192. Conceptual docs are being introduced in #42830.
Moreover, the PR also adjusts certain parts of the metrics doc in order to make it more accurate, synchronize it with the activities doc and incorporate the changes from #42810.
---------
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
|`http.connection.state`| string | State of HTTP connection in the HTTP connection pool. |`active`; `idle`| Always |
70
-
|`network.protocol.version`| string | Version of the application layer protocol used. |`1.1`; `2`| Always |
70
+
|`network.protocol.version`| string | Version of the HTTP protocol used. |`1.1`; `2`| Always |
71
71
|`server.address`| string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`example.com`| Always |
72
72
|`server.port`| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`80`; `8080`; `443`| If not default (`80` for `http` scheme, `443` for `https`) |
73
73
|`network.peer.address`| string | Peer IP address of the socket connection. |`10.5.3.2`| Always |
|`network.protocol.version`| string | Version of the application layer protocol used. |`1.1`; `2`| Always |
88
+
|`network.protocol.version`| string | Version of the HTTP protocol used. |`1.1`; `2`| Always |
89
89
|`server.address`| string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`example.com`| Always |
90
90
|`server.port`| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`80`; `8080`; `443`| If not default (`80` for `http` scheme, `443` for `https`) |
91
91
|`network.peer.address`| string | IP address of the socket connection. |`10.5.3.2`| Always |
@@ -105,14 +105,27 @@ Available starting in: .NET 8
|`error.type`| string | Request failure reason: one of the [HTTP request errors](xref:System.Net.Http.HttpRequestError), or a full exception type, or an HTTP 4xx/5xx status code. |`System.Threading.Tasks.TaskCanceledException`; `name_resolution_error`; `secure_connection_error` ; `404`| If request has failed. |
|`http.response.status_code`| int |[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). |`200`| If one was received. |
111
-
|`network.protocol.version`| string | Version of the application layer protocol used. |`1.1`; `2`| If response was received. |
108
+
|`error.type`| string | Request failure reason: one of the [HTTP request errors](xref:System.Net.Http.HttpRequestError) in snake_case, or a full exception type, or an HTTP 4xx/5xx status code. |`System.Threading.Tasks.TaskCanceledException`; `name_resolution_error`; `secure_connection_error` ; `404`| If request has failed. |
|`http.response.status_code`| int |[HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). |`200`| If response was received. |
111
+
|`network.protocol.version`| string | Version of the HTTP protocol used. |`1.1`; `2`| If response was received. |
112
112
|`server.address`| string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`example.com`| Always |
113
-
|`server.port`| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`80`; `8080`; `443`|If not default (`80` for `http` scheme, `443` for `https`)|
113
+
|`server.port`| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`80`; `8080`; `443`|Depends on .NET version. [3]|
114
114
|`url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`http`; `https`; `ftp`| Always |
115
115
116
+
**[1]`error.type`:** If the request has failed, the value is set to one of the following:
117
+
118
+
- An exception name with type, for example, <xref:System.Threading.Tasks.TaskCanceledException>.
119
+
- A status code that indicates a client or server error, for example, `500`.
120
+
- If an <xref:System.Net.Http.HttpRequestException> occurred with an <xref:System.Net.Http.HttpRequestError> other than `Unknown`, the enum value in snake case, for example, `name_resolution_error`.
121
+
122
+
**[2]`http.request.method`:**`http.request.method`:** The value contains the method name, if the method is one of the well-known methods listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods); otherwise the value is `_OTHER`. The user-provided method names will be mapped to known names in a case-insensitive manner. For example, if the user provides the name `GeT`, it will be mapped to `GET`.
123
+
124
+
**[3]`server.port`:** The Presence of the value is version-dependent:
125
+
126
+
-*.NET 8*: Present if not default (`80` for `http` scheme, `443` for `https`)
127
+
-*.NET 9+*: Always present
128
+
116
129
HTTP client request duration measures the time the underlying client handler takes to complete the request. Completing the request includes the time up to reading response headers from the network stream. It doesn't include the time spent reading the response body.
117
130
118
131
When using OpenTelemetry, the default buckets for this metric are set to [ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ].
|`network.protocol.version`| string | Version of the application layer protocol used. |`1.1`; `2`| Always |
147
+
|`network.protocol.version`| string | Version of the HTTP protocol used. |`1.1`; `2`| Always |
135
148
|`server.address`| string | Host identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`example.com`| Always |
136
149
|`server.port`| int | Port identifier of the ["URI origin"](https://www.rfc-editor.org/rfc/rfc9110.html#name-uri-origin) HTTP request is sent to. |`80`; `8080`; `443`| If not default (`80` for `http` scheme, `443` for `https`) |
137
150
|`url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. |`http`; `https`; `ftp`| Always |
0 commit comments