Skip to content

Commit

Permalink
Updating ref docs to include the metrics bucket information for conne…
Browse files Browse the repository at this point in the history
…ction histograms (#37811)

* Updating to include the metrics bucket information for open-telemetry/opentelemetry-dotnet#4922

* PR feedback

* Removing 0 bucket
Updated to square brackets to be in sync with the OTel docs.

---------

Co-authored-by: Sam Spencer <samsp@microsoft.com>
Co-authored-by: David Pine <david.pine@microsoft.com>
  • Loading branch information
3 people committed Feb 1, 2024
1 parent 5235b31 commit 58ca801
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/core/diagnostics/built-in-metrics-aspnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: ASP.NET Core metrics
description: Review the metrics available for ASP.NET Core
ms.topic: reference
ms.date: 11/02/2023
ms.date: 2/01/2024
---

# ASP.NET Core metrics
Expand Down Expand Up @@ -48,6 +48,9 @@ The time ends when:
- All response data has been sent.
- The context data structures for the request are being disposed.

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 ].

<!-- Once we migrate this doc to https://github.com/dotnet/AspNetCore.Docs we can remove the following version info -->
Available starting in: .NET 8.0.

##### Metric: `http.server.active_requests`
Expand Down Expand Up @@ -255,6 +258,8 @@ Available starting in: .NET 8.0.
| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. |
| `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. |

As this metric is tracking the connection duration, and ideally http connections are used for multiple requests, the buckets should be longer than those used for request durations. For example, using [ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300] provides an upper bucket of 5 mins.

Available starting in: .NET 8.0.

##### Metric: `kestrel.rejected_connections`
Expand Down Expand Up @@ -338,6 +343,8 @@ Available starting in: .NET 8.0.
| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. |
| `tls.protocol.version` | string | TLS protocol version. | `1.2`; `1.3` | If the connection is secured with TLS. |

When using OpenTelemetry, the default buckets for this metic 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 ].

Available starting in: .NET 8.0.

##### Metric: `kestrel.active_tls_handshakes`
Expand Down Expand Up @@ -375,6 +382,24 @@ The `Microsoft.AspNetCore.Http.Connections` metrics report connection informatio

Available starting in: .NET 8.0.

| Value | Description |
|---|---|
| `normal_closure` | The connection was closed normally. |
| `timeout` | The connection was closed due to a timeout. |
| `app_shutdown` | The connection was closed because the app is shutting down. |

`signalr.transport` is one of the following:

| Value | Protocol |
|---|---|
| `server_sent_events` | [server-sent events](https://developer.mozilla.org/docs/Web/API/Server-sent_events/Using_server-sent_events) |
| `long_polling` | [Long Polling](/archive/msdn-magazine/2012/april/cutting-edge-long-polling-and-signalr) |
| `web_sockets` | [WebSocket](https://datatracker.ietf.org/doc/html/rfc6455) |

As this metric is tracking the connection duration, and ideally SignalR connections are durable, the buckets should be longer than those used for request durations. For example, using [0, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300] provides an upper bucket of 5 mins.

Available starting in: .NET 8.0.

##### Metric: `signalr.server.active_connections`

| Name | Instrument Type | Unit (UCUM) | Description |
Expand Down
6 changes: 6 additions & 0 deletions docs/core/diagnostics/built-in-metrics-system-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Most errors when doing a DNS lookup throw a <xref:System.Net.Sockets.SocketExcep

Socket exceptions with any other `SocketError` value are reported as `System.Net.Sockets.SocketException`.

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 ].

Available starting in: .NET 8

## `System.Net.Http`
Expand Down Expand Up @@ -91,6 +93,8 @@ Available starting in: .NET 8

This metric is only captured when <xref:System.Net.Http.HttpClient> is configured to use the default <xref:System.Net.Http.SocketsHttpHandler>.

As this metric is tracking the connection duration, and ideally http connections are used for multiple requests, the buckets should be longer than those used for request durations. For example, using [ 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 30, 60, 120, 300 ] provides an upper bucket of 5 mins.

Available starting in: .NET 8

##### Metric: `http.client.request.duration`
Expand All @@ -111,6 +115,8 @@ Available starting in: .NET 8

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.

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 ].

Available starting in: .NET 8

> [!TIP]
Expand Down

0 comments on commit 58ca801

Please sign in to comment.