From 19afadbc543b2d9131a496b253e869980f66eaca Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:08:02 -1000 Subject: [PATCH 01/21] Move metric refer to ASP.NET repo --- aspnetcore/log-mon/metrics/built-in.md | 420 +++++++++++++++++++++++++ 1 file changed, 420 insertions(+) create mode 100644 aspnetcore/log-mon/metrics/built-in.md diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md new file mode 100644 index 000000000000..4e1ddc4bf47a --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -0,0 +1,420 @@ +--- +title: ASP.NET Core metrics +description: Metrics for ASP.NET Core apps +author: rick-anderson +ms.author: riande +monikerRange: '>= aspnetcore-8.0' +ms.date: 10/18/2023 +ms.topic: reference +uid: log-mon/metrics/built-in +--- + +# ASP.NET Core metrics + +This article describes the metrics built-in for ASP.NET Core produced using the + API. For a listing of metrics based on the older [EventCounters](event-counters.md) API, +see [here](available-counters.md). + +> [!TIP] +> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). + +## `Microsoft.AspNetCore.Hosting` + +The `Microsoft.AspNetCore.Hosting` metrics report high-level information about HTTP requests received by ASP.NET Core: + +- [`http.server.request.duration`](#metric-httpserverrequestduration) +- [`http.server.active_requests`](#metric-httpserveractive_requests) + +##### Metric: `http.server.request.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.route` | string | The matched route. | `{controller}/{action}/{id?}` | If it's available. | +| `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | +| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | +| `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | +| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | + +The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: + +- Sufficiently parsed the HTTP request headers on the inbound network stream to identify the new request. +- Initialized the context data structures such as the . + +The time ends when: + +- The ASP.NET Core handler pipeline is finished executing. +- 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 ]. + + +Available starting in: .NET 8.0. + +##### Metric: `http.server.active_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | +| `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Routing` + +The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTTP requests](/aspnet/core/fundamentals/routing) to ASP.NET Core endpoints: + +- [`aspnetcore.routing.match_attempts`](#metric-aspnetcoreroutingmatch_attempts) + +##### Metric: `aspnetcore.routing.match_attempts` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.routing.match_attempts`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcoreroutingmatch_attempts) | Counter | `{match_attempt}` | Number of requests that were attempted to be matched to an endpoint. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | +| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | +| `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Diagnostics` + +The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): + +- [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) + +##### Metric: `aspnetcore.diagnostics.exceptions` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | +| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | +| `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.RateLimiting` + +The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information from [ASP.NET Core rate-limiting middleware](/aspnet/core/performance/rate-limit): + +- [`aspnetcore.rate_limiting.active_request_leases`](#metric-aspnetcorerate_limitingactive_request_leases) +- [`aspnetcore.rate_limiting.request_lease.duration`](#metric-aspnetcorerate_limitingrequest_leaseduration) +- [`aspnetcore.rate_limiting.queued_requests`](#metric-aspnetcorerate_limitingqueued_requests) +- [`aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue) +- [`aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests) + +##### Metric: `aspnetcore.rate_limiting.active_request_leases` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request_lease.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.HeaderParsing` + +The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.NET Core header parsing](https://www.nuget.org/packages/Microsoft.AspNetCore.HeaderParsing): + +- [`aspnetcore.header_parsing.parse_errors`](#metric-aspnetcoreheader_parsingparse_errors) +- [`aspnetcore.header_parsing.cache_accesses`](#metric-aspnetcoreheader_parsingcache_accesses) + +##### Metric: `aspnetcore.header_parsing.parse_errors` + +| Name | Instrument Type | Unit (UCUM) | Description | +|--|--|--|--| +| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | + +| Attribute | Type | Description | Examples | Presence | +|--|--|--|--|--| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `error.type` | string | The error message. | `Unable to parse media type value.` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.header_parsing.cache_accesses` + +The metric is emitted only for HTTP request header parsers that support caching. + +| Name | Instrument Type | Unit (UCUM) | Description | +| ---- | --------------- | ----------- | ----------- | +| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Server.Kestrel` + +The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection information from [ASP.NET Core Kestrel web server](/aspnet/core/fundamentals/servers/kestrel): + +- [`kestrel.active_connections`](#metric-kestrelactive_connections) +- [`kestrel.connection.duration`](#metric-kestrelconnectionduration) +- [`kestrel.rejected_connections`](#metric-kestrelrejected_connections) +- [`kestrel.queued_connections`](#metric-kestrelqueued_connections) +- [`kestrel.queued_requests`](#metric-kestrelqueued_requests) +- [`kestrel.upgraded_connections`](#metric-kestrelupgraded_connections) +- [`kestrel.tls_handshake.duration`](#metric-kestreltls_handshakeduration) +- [`kestrel.active_tls_handshakes`](#metric-kestrelactive_tls_handshakes) + +##### Metric: `kestrel.active_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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. + +Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). + +Available starting in: .NET 8. + +##### Metric: `kestrel.rejected_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.rejected_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelrejected_connections) | Counter | `{connection}` | Number of connections rejected by the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_connections) | UpDownCounter | `{connection}` | Number of connections that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_requests) | UpDownCounter | `{request}` | Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.upgraded_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.upgraded_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelupgraded_connections) | UpDownCounter | `{connection}` | Number of connections that are currently upgraded (WebSockets). | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +The counter only tracks HTTP/1.1 connections. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.tls_handshake.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.tls_handshake.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestreltls_handshakeduration) | Histogram | `s` | The duration of TLS handshakes on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_tls_handshakes`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_tls_handshakes) | UpDownCounter | `{handshake}` | Number of TLS handshakes that are currently in progress on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Http.Connections` + +The `Microsoft.AspNetCore.Http.Connections` metrics report connection information from [ASP.NET Core SignalR](/aspnet/core/signalr/introduction): + +- [`signalr.server.connection.duration`](#metric-signalrserverconnectionduration) +- [`signalr.server.active_connections`](#metric-signalrserveractive_connections) + +##### Metric: `signalr.server.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserverconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +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 | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserveractive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +Available starting in: .NET 8.0. \ No newline at end of file From 04877c10403fc8e38888ca58dc8f9e99f3123119 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:14:35 -1000 Subject: [PATCH 02/21] Move metric refer to ASP.NET repo --- aspnetcore/log-mon/metrics/built-in.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index 4e1ddc4bf47a..1daac2c5dc25 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -9,11 +9,11 @@ ms.topic: reference uid: log-mon/metrics/built-in --- -# ASP.NET Core metrics +# ASP.NET Core built-in metrics This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](event-counters.md) API, -see [here](available-counters.md). + API. For a listing of metrics based on the older [EventCounters](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/event-counters) API, +see [here](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/available-counters). > [!TIP] > For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). From 6e22b3669b635b1ce60da30af6edec4af2a46163 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:20:00 -1000 Subject: [PATCH 03/21] Move metric refer to ASP.NET repo --- aspnetcore/log-mon/metrics/built-in.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index 1daac2c5dc25..af67cfc49a5d 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -1,6 +1,6 @@ --- -title: ASP.NET Core metrics -description: Metrics for ASP.NET Core apps +title: ASP.NET Core built-in metrics +description: Built-in metrics for ASP.NET Core apps author: rick-anderson ms.author: riande monikerRange: '>= aspnetcore-8.0' @@ -12,8 +12,8 @@ uid: log-mon/metrics/built-in # ASP.NET Core built-in metrics This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/event-counters) API, -see [here](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/available-counters). + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, +see [here](/dotnet/core/diagnostics/available-counters). > [!TIP] > For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). From b6e8c883bd587a09208eb24c30d6e53470f33a67 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:32:14 -1000 Subject: [PATCH 04/21] Move metric refer to ASP.NET repo --- aspnetcore/log-mon/metrics/built-in.md | 408 +---------------- .../metrics/built-in/includes/built-in10.md | 410 ++++++++++++++++++ .../metrics/built-in/includes/built-in8.md | 410 ++++++++++++++++++ 3 files changed, 822 insertions(+), 406 deletions(-) create mode 100644 aspnetcore/log-mon/metrics/built-in/includes/built-in10.md create mode 100644 aspnetcore/log-mon/metrics/built-in/includes/built-in8.md diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index af67cfc49a5d..f0b412dc8efd 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -11,410 +11,6 @@ uid: log-mon/metrics/built-in # ASP.NET Core built-in metrics -This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, -see [here](/dotnet/core/diagnostics/available-counters). +[!INCLUDE[](~/log-mon/metrics/built-in/includes/built-in10.md)] -> [!TIP] -> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). - -## `Microsoft.AspNetCore.Hosting` - -The `Microsoft.AspNetCore.Hosting` metrics report high-level information about HTTP requests received by ASP.NET Core: - -- [`http.server.request.duration`](#metric-httpserverrequestduration) -- [`http.server.active_requests`](#metric-httpserveractive_requests) - -##### Metric: `http.server.request.duration` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `http.route` | string | The matched route. | `{controller}/{action}/{id?}` | If it's available. | -| `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | -| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | -| `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | -| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | -| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | -| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | - -The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: - -- Sufficiently parsed the HTTP request headers on the inbound network stream to identify the new request. -- Initialized the context data structures such as the . - -The time ends when: - -- The ASP.NET Core handler pipeline is finished executing. -- 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 ]. - - -Available starting in: .NET 8.0. - -##### Metric: `http.server.active_requests` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | -| `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.Routing` - -The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTTP requests](/aspnet/core/fundamentals/routing) to ASP.NET Core endpoints: - -- [`aspnetcore.routing.match_attempts`](#metric-aspnetcoreroutingmatch_attempts) - -##### Metric: `aspnetcore.routing.match_attempts` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.routing.match_attempts`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcoreroutingmatch_attempts) | Counter | `{match_attempt}` | Number of requests that were attempted to be matched to an endpoint. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | -| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | -| `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.Diagnostics` - -The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): - -- [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) - -##### Metric: `aspnetcore.diagnostics.exceptions` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | -| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | -| `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.RateLimiting` - -The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information from [ASP.NET Core rate-limiting middleware](/aspnet/core/performance/rate-limit): - -- [`aspnetcore.rate_limiting.active_request_leases`](#metric-aspnetcorerate_limitingactive_request_leases) -- [`aspnetcore.rate_limiting.request_lease.duration`](#metric-aspnetcorerate_limitingrequest_leaseduration) -- [`aspnetcore.rate_limiting.queued_requests`](#metric-aspnetcorerate_limitingqueued_requests) -- [`aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue) -- [`aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests) - -##### Metric: `aspnetcore.rate_limiting.active_request_leases` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | - -Available starting in: .NET 8.0. - -##### Metric: `aspnetcore.rate_limiting.request_lease.duration` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | - -Available starting in: .NET 8.0. - -##### Metric: `aspnetcore.rate_limiting.queued_requests` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | - -Available starting in: .NET 8.0. - -##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | - -Available starting in: .NET 8.0. - -##### Metric: `aspnetcore.rate_limiting.requests` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.HeaderParsing` - -The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.NET Core header parsing](https://www.nuget.org/packages/Microsoft.AspNetCore.HeaderParsing): - -- [`aspnetcore.header_parsing.parse_errors`](#metric-aspnetcoreheader_parsingparse_errors) -- [`aspnetcore.header_parsing.cache_accesses`](#metric-aspnetcoreheader_parsingcache_accesses) - -##### Metric: `aspnetcore.header_parsing.parse_errors` - -| Name | Instrument Type | Unit (UCUM) | Description | -|--|--|--|--| -| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | - -| Attribute | Type | Description | Examples | Presence | -|--|--|--|--|--| -| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | -| `error.type` | string | The error message. | `Unable to parse media type value.` | Always | - -Available starting in: .NET 8.0. - -##### Metric: `aspnetcore.header_parsing.cache_accesses` - -The metric is emitted only for HTTP request header parsers that support caching. - -| Name | Instrument Type | Unit (UCUM) | Description | -| ---- | --------------- | ----------- | ----------- | -| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | -| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.Server.Kestrel` - -The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection information from [ASP.NET Core Kestrel web server](/aspnet/core/fundamentals/servers/kestrel): - -- [`kestrel.active_connections`](#metric-kestrelactive_connections) -- [`kestrel.connection.duration`](#metric-kestrelconnectionduration) -- [`kestrel.rejected_connections`](#metric-kestrelrejected_connections) -- [`kestrel.queued_connections`](#metric-kestrelqueued_connections) -- [`kestrel.queued_requests`](#metric-kestrelqueued_requests) -- [`kestrel.upgraded_connections`](#metric-kestrelupgraded_connections) -- [`kestrel.tls_handshake.duration`](#metric-kestreltls_handshakeduration) -- [`kestrel.active_tls_handshakes`](#metric-kestrelactive_tls_handshakes) - -##### Metric: `kestrel.active_connections` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -Available starting in: .NET 8.0. - -##### Metric: `kestrel.connection.duration` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelconnectionduration) | Histogram | `s` | The duration of connections on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | -| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `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. - -Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). - -Available starting in: .NET 8. - -##### Metric: `kestrel.rejected_connections` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.rejected_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelrejected_connections) | Counter | `{connection}` | Number of connections rejected by the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. - -Available starting in: .NET 8.0. - -##### Metric: `kestrel.queued_connections` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.queued_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_connections) | UpDownCounter | `{connection}` | Number of connections that are currently queued and are waiting to start. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -Available starting in: .NET 8.0. - -##### Metric: `kestrel.queued_requests` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_requests) | UpDownCounter | `{request}` | Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | -| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -Available starting in: .NET 8.0. - -##### Metric: `kestrel.upgraded_connections` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.upgraded_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelupgraded_connections) | UpDownCounter | `{connection}` | Number of connections that are currently upgraded (WebSockets). | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -The counter only tracks HTTP/1.1 connections. - -Available starting in: .NET 8.0. - -##### Metric: `kestrel.tls_handshake.duration` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.tls_handshake.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestreltls_handshakeduration) | Histogram | `s` | The duration of TLS handshakes on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `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` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`kestrel.active_tls_handshakes`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_tls_handshakes) | UpDownCounter | `{handshake}` | Number of TLS handshakes that are currently in progress on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | -| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | -| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | -| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | - -Available starting in: .NET 8.0. - -## `Microsoft.AspNetCore.Http.Connections` - -The `Microsoft.AspNetCore.Http.Connections` metrics report connection information from [ASP.NET Core SignalR](/aspnet/core/signalr/introduction): - -- [`signalr.server.connection.duration`](#metric-signalrserverconnectionduration) -- [`signalr.server.active_connections`](#metric-signalrserveractive_connections) - -##### Metric: `signalr.server.connection.duration` - -| Name | Instrument Type | Unit (UCUM) | Description | -| -------- | --------------- | ----------- | -------------- | -| [`signalr.server.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserverconnectionduration) | Histogram | `s` | The duration of connections on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | -| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | - -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 | -| -------- | --------------- | ----------- | -------------- | -| [`signalr.server.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserveractive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | - -| Attribute | Type | Description | Examples | Presence | -|---|---|---|---|---| -| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | -| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | - -Available starting in: .NET 8.0. \ No newline at end of file +[!INCLUDE[](~/log-mon/metrics/built-in/includes/built-in8.md)] \ No newline at end of file diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md new file mode 100644 index 000000000000..d2fd816f6fef --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -0,0 +1,410 @@ +:::moniker range=">= aspnetcore-10.0" + +This article describes the metrics built-in for ASP.NET Core produced using the + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, +see [here](/dotnet/core/diagnostics/available-counters). + +> [!TIP] +> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). + +## `Microsoft.AspNetCore.Hosting` + +The `Microsoft.AspNetCore.Hosting` metrics report high-level information about HTTP requests received by ASP.NET Core: + +- [`http.server.request.duration`](#metric-httpserverrequestduration) +- [`http.server.active_requests`](#metric-httpserveractive_requests) + +##### Metric: `http.server.request.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.route` | string | The matched route. | `{controller}/{action}/{id?}` | If it's available. | +| `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | +| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | +| `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | +| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | + +The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: + +- Sufficiently parsed the HTTP request headers on the inbound network stream to identify the new request. +- Initialized the context data structures such as the . + +The time ends when: + +- The ASP.NET Core handler pipeline is finished executing. +- 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 ]. + + +Available starting in: .NET 8.0. + +##### Metric: `http.server.active_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | +| `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Routing` + +The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTTP requests](/aspnet/core/fundamentals/routing) to ASP.NET Core endpoints: + +- [`aspnetcore.routing.match_attempts`](#metric-aspnetcoreroutingmatch_attempts) + +##### Metric: `aspnetcore.routing.match_attempts` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.routing.match_attempts`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcoreroutingmatch_attempts) | Counter | `{match_attempt}` | Number of requests that were attempted to be matched to an endpoint. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | +| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | +| `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Diagnostics` + +The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): + +- [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) + +##### Metric: `aspnetcore.diagnostics.exceptions` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | +| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | +| `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.RateLimiting` + +The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information from [ASP.NET Core rate-limiting middleware](/aspnet/core/performance/rate-limit): + +- [`aspnetcore.rate_limiting.active_request_leases`](#metric-aspnetcorerate_limitingactive_request_leases) +- [`aspnetcore.rate_limiting.request_lease.duration`](#metric-aspnetcorerate_limitingrequest_leaseduration) +- [`aspnetcore.rate_limiting.queued_requests`](#metric-aspnetcorerate_limitingqueued_requests) +- [`aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue) +- [`aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests) + +##### Metric: `aspnetcore.rate_limiting.active_request_leases` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request_lease.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.HeaderParsing` + +The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.NET Core header parsing](https://www.nuget.org/packages/Microsoft.AspNetCore.HeaderParsing): + +- [`aspnetcore.header_parsing.parse_errors`](#metric-aspnetcoreheader_parsingparse_errors) +- [`aspnetcore.header_parsing.cache_accesses`](#metric-aspnetcoreheader_parsingcache_accesses) + +##### Metric: `aspnetcore.header_parsing.parse_errors` + +| Name | Instrument Type | Unit (UCUM) | Description | +|--|--|--|--| +| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | + +| Attribute | Type | Description | Examples | Presence | +|--|--|--|--|--| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `error.type` | string | The error message. | `Unable to parse media type value.` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.header_parsing.cache_accesses` + +The metric is emitted only for HTTP request header parsers that support caching. + +| Name | Instrument Type | Unit (UCUM) | Description | +| ---- | --------------- | ----------- | ----------- | +| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Server.Kestrel` + +The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection information from [ASP.NET Core Kestrel web server](/aspnet/core/fundamentals/servers/kestrel): + +- [`kestrel.active_connections`](#metric-kestrelactive_connections) +- [`kestrel.connection.duration`](#metric-kestrelconnectionduration) +- [`kestrel.rejected_connections`](#metric-kestrelrejected_connections) +- [`kestrel.queued_connections`](#metric-kestrelqueued_connections) +- [`kestrel.queued_requests`](#metric-kestrelqueued_requests) +- [`kestrel.upgraded_connections`](#metric-kestrelupgraded_connections) +- [`kestrel.tls_handshake.duration`](#metric-kestreltls_handshakeduration) +- [`kestrel.active_tls_handshakes`](#metric-kestrelactive_tls_handshakes) + +##### Metric: `kestrel.active_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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. + +Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). + +Available starting in: .NET 8. + +##### Metric: `kestrel.rejected_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.rejected_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelrejected_connections) | Counter | `{connection}` | Number of connections rejected by the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_connections) | UpDownCounter | `{connection}` | Number of connections that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_requests) | UpDownCounter | `{request}` | Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.upgraded_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.upgraded_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelupgraded_connections) | UpDownCounter | `{connection}` | Number of connections that are currently upgraded (WebSockets). | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +The counter only tracks HTTP/1.1 connections. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.tls_handshake.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.tls_handshake.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestreltls_handshakeduration) | Histogram | `s` | The duration of TLS handshakes on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_tls_handshakes`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_tls_handshakes) | UpDownCounter | `{handshake}` | Number of TLS handshakes that are currently in progress on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Http.Connections` + +The `Microsoft.AspNetCore.Http.Connections` metrics report connection information from [ASP.NET Core SignalR](/aspnet/core/signalr/introduction): + +- [`signalr.server.connection.duration`](#metric-signalrserverconnectionduration) +- [`signalr.server.active_connections`](#metric-signalrserveractive_connections) + +##### Metric: `signalr.server.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserverconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +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 | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserveractive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +Available starting in: .NET 8.0. +:::moniker-end diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md new file mode 100644 index 000000000000..6b0162cc1c41 --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -0,0 +1,410 @@ +:::moniker range="< aspnetcore-10.0" + +This article describes the metrics built-in for ASP.NET Core produced using the + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, +see [here](/dotnet/core/diagnostics/available-counters). + +> [!TIP] +> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). + +## `Microsoft.AspNetCore.Hosting` + +The `Microsoft.AspNetCore.Hosting` metrics report high-level information about HTTP requests received by ASP.NET Core: + +- [`http.server.request.duration`](#metric-httpserverrequestduration) +- [`http.server.active_requests`](#metric-httpserveractive_requests) + +##### Metric: `http.server.request.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.request.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientrequestduration) | Histogram | `s` | Measures the duration of inbound HTTP requests. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.route` | string | The matched route. | `{controller}/{action}/{id?}` | If it's available. | +| `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | +| `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | +| `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | +| `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | +| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | + +The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: + +- Sufficiently parsed the HTTP request headers on the inbound network stream to identify the new request. +- Initialized the context data structures such as the . + +The time ends when: + +- The ASP.NET Core handler pipeline is finished executing. +- 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 ]. + + +Available starting in: .NET 8.0. + +##### Metric: `http.server.active_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpclientactive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | +| `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Routing` + +The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTTP requests](/aspnet/core/fundamentals/routing) to ASP.NET Core endpoints: + +- [`aspnetcore.routing.match_attempts`](#metric-aspnetcoreroutingmatch_attempts) + +##### Metric: `aspnetcore.routing.match_attempts` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.routing.match_attempts`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcoreroutingmatch_attempts) | Counter | `{match_attempt}` | Number of requests that were attempted to be matched to an endpoint. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | +| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | +| `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Diagnostics` + +The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): + +- [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) + +##### Metric: `aspnetcore.diagnostics.exceptions` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | +| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | +| `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.RateLimiting` + +The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information from [ASP.NET Core rate-limiting middleware](/aspnet/core/performance/rate-limit): + +- [`aspnetcore.rate_limiting.active_request_leases`](#metric-aspnetcorerate_limitingactive_request_leases) +- [`aspnetcore.rate_limiting.request_lease.duration`](#metric-aspnetcorerate_limitingrequest_leaseduration) +- [`aspnetcore.rate_limiting.queued_requests`](#metric-aspnetcorerate_limitingqueued_requests) +- [`aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue) +- [`aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests) + +##### Metric: `aspnetcore.rate_limiting.active_request_leases` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request_lease.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.rate_limiting.requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.HeaderParsing` + +The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.NET Core header parsing](https://www.nuget.org/packages/Microsoft.AspNetCore.HeaderParsing): + +- [`aspnetcore.header_parsing.parse_errors`](#metric-aspnetcoreheader_parsingparse_errors) +- [`aspnetcore.header_parsing.cache_accesses`](#metric-aspnetcoreheader_parsingcache_accesses) + +##### Metric: `aspnetcore.header_parsing.parse_errors` + +| Name | Instrument Type | Unit (UCUM) | Description | +|--|--|--|--| +| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | + +| Attribute | Type | Description | Examples | Presence | +|--|--|--|--|--| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `error.type` | string | The error message. | `Unable to parse media type value.` | Always | + +Available starting in: .NET 8.0. + +##### Metric: `aspnetcore.header_parsing.cache_accesses` + +The metric is emitted only for HTTP request header parsers that support caching. + +| Name | Instrument Type | Unit (UCUM) | Description | +| ---- | --------------- | ----------- | ----------- | +| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Server.Kestrel` + +The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection information from [ASP.NET Core Kestrel web server](/aspnet/core/fundamentals/servers/kestrel): + +- [`kestrel.active_connections`](#metric-kestrelactive_connections) +- [`kestrel.connection.duration`](#metric-kestrelconnectionduration) +- [`kestrel.rejected_connections`](#metric-kestrelrejected_connections) +- [`kestrel.queued_connections`](#metric-kestrelqueued_connections) +- [`kestrel.queued_requests`](#metric-kestrelqueued_requests) +- [`kestrel.upgraded_connections`](#metric-kestrelupgraded_connections) +- [`kestrel.tls_handshake.duration`](#metric-kestreltls_handshakeduration) +- [`kestrel.active_tls_handshakes`](#metric-kestrelactive_tls_handshakes) + +##### Metric: `kestrel.active_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type`| string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | Describes a type of error the connection ended with, or the unhandled exception type thrown during the connection pipeline. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). | `connection_reset`; `invalid_request_headers`; `System.OperationCanceledException` | If the connection ended with a known error or an exception was thrown. | +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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. + +Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). + +Available starting in: .NET 8. + +##### Metric: `kestrel.rejected_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.rejected_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelrejected_connections) | Counter | `{connection}` | Number of connections rejected by the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport`| string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address`| string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_connections) | UpDownCounter | `{connection}` | Number of connections that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.queued_requests` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelqueued_requests) | UpDownCounter | `{request}` | Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.protocol.name` | string | [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. | `http`; `web_sockets` | Always | +| `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `1.1`; `2` | Always | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.upgraded_connections` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.upgraded_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelupgraded_connections) | UpDownCounter | `{connection}` | Number of connections that are currently upgraded (WebSockets). | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +The counter only tracks HTTP/1.1 connections. + +Available starting in: .NET 8.0. + +##### Metric: `kestrel.tls_handshake.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.tls_handshake.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestreltls_handshakeduration) | Histogram | `s` | The duration of TLS handshakes on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `error.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | If an exception was thrown. | +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `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` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`kestrel.active_tls_handshakes`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/#metric-kestrelactive_tls_handshakes) | UpDownCounter | `{handshake}` | Number of TLS handshakes that are currently in progress on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `network.transport` | string | [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always | +| `network.type` | string | [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. | `ipv4`; `ipv6` | If the transport is `tcp` or `udp`. | +| `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | +| `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | + +Available starting in: .NET 8.0. + +## `Microsoft.AspNetCore.Http.Connections` + +The `Microsoft.AspNetCore.Http.Connections` metrics report connection information from [ASP.NET Core SignalR](/aspnet/core/signalr/introduction): + +- [`signalr.server.connection.duration`](#metric-signalrserverconnectionduration) +- [`signalr.server.active_connections`](#metric-signalrserveractive_connections) + +##### Metric: `signalr.server.connection.duration` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.connection.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserverconnectionduration) | Histogram | `s` | The duration of connections on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +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 | +| -------- | --------------- | ----------- | -------------- | +| [`signalr.server.active_connections`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/#metric-signalrserveractive_connections) | UpDownCounter | `{connection}` | Number of connections that are currently active on the server. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | +| `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | + +Available starting in: .NET 8.0. +:::moniker-end From 93194491d6a6e34c1b6f5def2a3c1620d5da8d56 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:34:06 -1000 Subject: [PATCH 05/21] Move metric refer to ASP.NET repo --- aspnetcore/log-mon/metrics/built-in.md | 1 - aspnetcore/log-mon/metrics/built-in/includes/built-in8.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index f0b412dc8efd..c9f4d9433ff0 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -3,7 +3,6 @@ title: ASP.NET Core built-in metrics description: Built-in metrics for ASP.NET Core apps author: rick-anderson ms.author: riande -monikerRange: '>= aspnetcore-8.0' ms.date: 10/18/2023 ms.topic: reference uid: log-mon/metrics/built-in diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index 6b0162cc1c41..b87431c1f885 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -1,4 +1,4 @@ -:::moniker range="< aspnetcore-10.0" +:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0" This article describes the metrics built-in for ASP.NET Core produced using the API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, From 648fcb0c1e1a40596146d4dadf58083bc59e9a14 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 08:50:48 -1000 Subject: [PATCH 06/21] Move metric refer to ASP.NET repo --- .../metrics/built-in/includes/built-in10.md | 44 +++++++++---------- .../metrics/built-in/includes/built-in8.md | 44 ------------------- 2 files changed, 22 insertions(+), 66 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index d2fd816f6fef..f7f078b9c1a0 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -44,7 +44,7 @@ The time ends when: 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.0. +. ##### Metric: `http.server.active_requests` @@ -57,7 +57,7 @@ Available starting in: .NET 8.0. | `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | | `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.Routing` @@ -77,7 +77,7 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT | `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | | `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.Diagnostics` @@ -97,7 +97,7 @@ The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information fr | `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | | `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.RateLimiting` @@ -119,7 +119,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. +. ##### Metric: `aspnetcore.rate_limiting.request_lease.duration` @@ -131,7 +131,7 @@ Available starting in: .NET 8.0. |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. +. ##### Metric: `aspnetcore.rate_limiting.queued_requests` @@ -143,7 +143,7 @@ Available starting in: .NET 8.0. |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. +. ##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` @@ -156,7 +156,7 @@ Available starting in: .NET 8.0. | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | | `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | -Available starting in: .NET 8.0. +. ##### Metric: `aspnetcore.rate_limiting.requests` @@ -169,7 +169,7 @@ Available starting in: .NET 8.0. | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | | `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.HeaderParsing` @@ -189,7 +189,7 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N | `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `error.type` | string | The error message. | `Unable to parse media type value.` | Always | -Available starting in: .NET 8.0. +. ##### Metric: `aspnetcore.header_parsing.cache_accesses` @@ -204,7 +204,7 @@ The metric is emitted only for HTTP request header parsers that support caching. | `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.Server.Kestrel` @@ -232,7 +232,7 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. +. ##### Metric: `kestrel.connection.duration` @@ -255,7 +255,7 @@ As this metric is tracking the connection duration, and ideally http connections Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). -Available starting in: .NET 8. + ##### Metric: `kestrel.rejected_connections` @@ -272,7 +272,7 @@ Available starting in: .NET 8. Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. -Available starting in: .NET 8.0. +. ##### Metric: `kestrel.queued_connections` @@ -287,7 +287,7 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. +. ##### Metric: `kestrel.queued_requests` @@ -304,7 +304,7 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. +. ##### Metric: `kestrel.upgraded_connections` @@ -321,7 +321,7 @@ Available starting in: .NET 8.0. The counter only tracks HTTP/1.1 connections. -Available starting in: .NET 8.0. +. ##### Metric: `kestrel.tls_handshake.duration` @@ -340,7 +340,7 @@ Available starting in: .NET 8.0. 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` @@ -355,7 +355,7 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. +. ## `Microsoft.AspNetCore.Http.Connections` @@ -375,7 +375,7 @@ The `Microsoft.AspNetCore.Http.Connections` metrics report connection informatio | `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | | `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | -Available starting in: .NET 8.0. +. | Value | Description | |---|---| @@ -393,7 +393,7 @@ Available starting in: .NET 8.0. 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` @@ -406,5 +406,5 @@ Available starting in: .NET 8.0. | `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | | `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | -Available starting in: .NET 8.0. +. :::moniker-end diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index b87431c1f885..7e1f3d3fcaa9 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -43,9 +43,6 @@ The time ends when: 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.0. - ##### Metric: `http.server.active_requests` | Name | Instrument Type | Unit (UCUM) | Description | @@ -57,8 +54,6 @@ Available starting in: .NET 8.0. | `http.request.method` | string | HTTP request method. [1] | `GET`; `POST`; `HEAD` | Always | | `url.scheme`| string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.Routing` The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTTP requests](/aspnet/core/fundamentals/routing) to ASP.NET Core endpoints: @@ -77,8 +72,6 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT | `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | | `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.Diagnostics` The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): @@ -97,8 +90,6 @@ The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information fr | `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | | `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.RateLimiting` The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information from [ASP.NET Core rate-limiting middleware](/aspnet/core/performance/rate-limit): @@ -119,8 +110,6 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. - ##### Metric: `aspnetcore.rate_limiting.request_lease.duration` | Name | Instrument Type | Unit (UCUM) | Description | @@ -131,8 +120,6 @@ Available starting in: .NET 8.0. |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. - ##### Metric: `aspnetcore.rate_limiting.queued_requests` | Name | Instrument Type | Unit (UCUM) | Description | @@ -143,8 +130,6 @@ Available starting in: .NET 8.0. |---|---|---|---|---| | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -Available starting in: .NET 8.0. - ##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` | Name | Instrument Type | Unit (UCUM) | Description | @@ -156,8 +141,6 @@ Available starting in: .NET 8.0. | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | | `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | -Available starting in: .NET 8.0. - ##### Metric: `aspnetcore.rate_limiting.requests` | Name | Instrument Type | Unit (UCUM) | Description | @@ -169,8 +152,6 @@ Available starting in: .NET 8.0. | `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | | `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.HeaderParsing` The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.NET Core header parsing](https://www.nuget.org/packages/Microsoft.AspNetCore.HeaderParsing): @@ -189,8 +170,6 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N | `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `error.type` | string | The error message. | `Unable to parse media type value.` | Always | -Available starting in: .NET 8.0. - ##### Metric: `aspnetcore.header_parsing.cache_accesses` The metric is emitted only for HTTP request header parsers that support caching. @@ -204,8 +183,6 @@ The metric is emitted only for HTTP request header parsers that support caching. | `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.Server.Kestrel` The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection information from [ASP.NET Core Kestrel web server](/aspnet/core/fundamentals/servers/kestrel): @@ -232,8 +209,6 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port`| int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. - ##### Metric: `kestrel.connection.duration` | Name | Instrument Type | Unit (UCUM) | Description | @@ -255,8 +230,6 @@ As this metric is tracking the connection duration, and ideally http connections Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). -Available starting in: .NET 8. - ##### Metric: `kestrel.rejected_connections` | Name | Instrument Type | Unit (UCUM) | Description | @@ -272,8 +245,6 @@ Available starting in: .NET 8. Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. -Available starting in: .NET 8.0. - ##### Metric: `kestrel.queued_connections` | Name | Instrument Type | Unit (UCUM) | Description | @@ -287,8 +258,6 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. - ##### Metric: `kestrel.queued_requests` | Name | Instrument Type | Unit (UCUM) | Description | @@ -304,8 +273,6 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. - ##### Metric: `kestrel.upgraded_connections` | Name | Instrument Type | Unit (UCUM) | Description | @@ -321,8 +288,6 @@ Available starting in: .NET 8.0. The counter only tracks HTTP/1.1 connections. -Available starting in: .NET 8.0. - ##### Metric: `kestrel.tls_handshake.duration` | Name | Instrument Type | Unit (UCUM) | Description | @@ -340,8 +305,6 @@ Available starting in: .NET 8.0. 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` | Name | Instrument Type | Unit (UCUM) | Description | @@ -355,8 +318,6 @@ Available starting in: .NET 8.0. | `server.address` | string | Server address domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. | `example.com` | Always | | `server.port` | int | Server port number | `80`; `8080`; `443` | If the transport is `tcp` or `udp`. | -Available starting in: .NET 8.0. - ## `Microsoft.AspNetCore.Http.Connections` The `Microsoft.AspNetCore.Http.Connections` metrics report connection information from [ASP.NET Core SignalR](/aspnet/core/signalr/introduction): @@ -375,8 +336,6 @@ The `Microsoft.AspNetCore.Http.Connections` metrics report connection informatio | `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | | `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | -Available starting in: .NET 8.0. - | Value | Description | |---|---| | `normal_closure` | The connection was closed normally. | @@ -393,8 +352,6 @@ Available starting in: .NET 8.0. 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 | @@ -406,5 +363,4 @@ Available starting in: .NET 8.0. | `signalr.connection.status` | string | SignalR HTTP connection closure status. | `app_shutdown`; `timeout` | Always | | `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | -Available starting in: .NET 8.0. :::moniker-end From 7432661dc97333c1ec335d4561724fd52547a396 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 08:52:24 -1000 Subject: [PATCH 07/21] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- aspnetcore/log-mon/metrics/built-in/includes/built-in8.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index f7f078b9c1a0..9bb4c98bdee1 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -2,7 +2,7 @@ This article describes the metrics built-in for ASP.NET Core produced using the API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, -see [here](/dotnet/core/diagnostics/available-counters). +see [Available counters](/dotnet/core/diagnostics/available-counters). > [!TIP] > For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index 7e1f3d3fcaa9..0ee2b7f338b8 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -2,7 +2,7 @@ This article describes the metrics built-in for ASP.NET Core produced using the API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, -see [here](/dotnet/core/diagnostics/available-counters). +see [Available counters](/dotnet/core/diagnostics/available-counters). > [!TIP] > For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). From 165f466bb17742f27be222cfc0ec20fcc479c31d Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 08:56:03 -1000 Subject: [PATCH 08/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- aspnetcore/log-mon/metrics/built-in/includes/built-in8.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 9bb4c98bdee1..d823da52b3c5 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -5,7 +5,7 @@ This article describes the metrics built-in for ASP.NET Core produced using the see [Available counters](/dotnet/core/diagnostics/available-counters). > [!TIP] -> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). +> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics). ## `Microsoft.AspNetCore.Hosting` diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index 0ee2b7f338b8..0c99f637d5d3 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -5,7 +5,7 @@ This article describes the metrics built-in for ASP.NET Core produced using the see [Available counters](/dotnet/core/diagnostics/available-counters). > [!TIP] -> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](/aspnet/core/log-mon/metrics/metrics). +> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics). ## `Microsoft.AspNetCore.Hosting` From 2a2f7c8f1f13db607b883476166d96e257892416 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:06:04 -1000 Subject: [PATCH 09/21] react to feedback --- aspnetcore/toc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 008314be81b7..c819e11a81f8 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -287,8 +287,8 @@ items: - name: Metrics overview displayName: logging, monitoring uid: log-mon/metrics/metrics - - name: Built-in metrics >> - href: /dotnet/core/diagnostics/built-in-metrics-aspnetcore + - name: Built-in metrics + uid: log-mon/metrics/metrics-built-in - name: HttpContext uid: fundamentals/use-httpcontext - name: Routing From 5ad76e4346fda5aff5e03851106a2e2bb9019796 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:57:08 -1000 Subject: [PATCH 10/21] react to feedback --- aspnetcore/toc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index c819e11a81f8..fbec9a8309df 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -288,7 +288,7 @@ items: displayName: logging, monitoring uid: log-mon/metrics/metrics - name: Built-in metrics - uid: log-mon/metrics/metrics-built-in + uid: log-mon/metrics/built-in - name: HttpContext uid: fundamentals/use-httpcontext - name: Routing From 2f602588fe0ba2259704addacfa624e8779d06e6 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:07:11 -1000 Subject: [PATCH 11/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index d823da52b3c5..522b7782b843 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -4,8 +4,7 @@ This article describes the metrics built-in for ASP.NET Core produced using the API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters). -> [!TIP] -> For more information about how to collect, report, enrich, and test ASP.NET Core metrics, see [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics). +See [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics) for information about how to collect, report, enrich, and test ASP.NET Core metrics ## `Microsoft.AspNetCore.Hosting` From 4dd0b6f05f84fbecc95db77aba2dc77b3bd1226b Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 10:07:27 -1000 Subject: [PATCH 12/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 522b7782b843..0c5a362a0187 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -1,8 +1,7 @@ :::moniker range=">= aspnetcore-10.0" This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, -see [Available counters](/dotnet/core/diagnostics/available-counters). + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters). See [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics) for information about how to collect, report, enrich, and test ASP.NET Core metrics From d43a863deff6d761f042e96e640819ef1f68601d Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 11:51:14 -1000 Subject: [PATCH 13/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 0c5a362a0187..53985528a194 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -1,7 +1,7 @@ :::moniker range=">= aspnetcore-10.0" This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters). + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API,see [Available counters](/dotnet/core/diagnostics/available-counters). See [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics) for information about how to collect, report, enrich, and test ASP.NET Core metrics @@ -20,7 +20,7 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `http.route` | string | The matched route. | `{controller}/{action}/{id?}` | If it's available. | +| `http.route` | string | The matched route. | `{controller}/{action}/`
`{id?}`| If it's available. | | `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | | `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | From 3e900449630a0f368f0a86341f30b80a3e80e4a8 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 11:58:50 -1000 Subject: [PATCH 14/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 53985528a194..76a19020900d 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -26,7 +26,7 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | | `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | -| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | +| `aspnetcore.request.`
`is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: From 738c6020b40c27bf63fe05928475a04b1111faf5 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:23:41 -1000 Subject: [PATCH 15/21] react to feedback --- .../metrics/built-in/includes/built-in10.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 76a19020900d..efa757d28557 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -71,9 +71,9 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | -| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | -| `http.route` | string | The matched route | `{controller}/{action}/{id?}` | If a route was successfully matched. | +| `aspnetcore.routing`
`.match_status` | string | Match result | `success`; `failure` | Always | +| `aspnetcore.routing.`
`is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | +| `http.route` | string | The matched route | `{controller}/{action}/`
`{id?}` | If a route was successfully matched. | . @@ -87,12 +87,12 @@ The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information fr | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | +| [`aspnetcore.diagnostics.`
`exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | -| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | +| `aspnetcore.diagnostics.`
`exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | +| `aspnetcore.diagnostics`
`.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | | `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | . @@ -111,7 +111,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | +| [`aspnetcore.rate_limiting.`
`active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -123,7 +123,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | +| [`aspnetcore.rate_limiting.`
`request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -135,7 +135,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.`
`queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -147,12 +147,12 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.`
`request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | +| `aspnetcore.rate_limiting.`
`policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.`
`result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | . @@ -160,12 +160,12 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.`
`requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | +| `aspnetcore.rate_limiting.`
`policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.`
`result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | . @@ -180,11 +180,11 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N | Name | Instrument Type | Unit (UCUM) | Description | |--|--|--|--| -| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | +| `aspnetcore.header_parsing.`
`parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | | Attribute | Type | Description | Examples | Presence | |--|--|--|--|--| -| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.`
`header.name` | string | The header name. | `Content-Type` | Always | | `error.type` | string | The error message. | `Unable to parse media type value.` | Always | . @@ -195,12 +195,12 @@ The metric is emitted only for HTTP request header parsers that support caching. | Name | Instrument Type | Unit (UCUM) | Description | | ---- | --------------- | ----------- | ----------- | -| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | +| `aspnetcore.header_parsing.`
`cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | -| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | +| `aspnetcore.header_parsing.`
`header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.`
`cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | . From 564076d3e279f6a9e094d6dbb5ff13bc74ffe0b5 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:29:10 -1000 Subject: [PATCH 16/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index efa757d28557..2fff10f436d7 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -200,7 +200,7 @@ The metric is emitted only for HTTP request header parsers that support caching. | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.header_parsing.`
`header.name` | string | The header name. | `Content-Type` | Always | -| `aspnetcore.header_parsing.`
`cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | +| `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | . From 98bd66b698cce2de10c46e3f44d02de01dec62f6 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 12:32:16 -1000 Subject: [PATCH 17/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 2fff10f436d7..4d5b1bf68a83 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -12,7 +12,7 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H - [`http.server.request.duration`](#metric-httpserverrequestduration) - [`http.server.active_requests`](#metric-httpserveractive_requests) -##### Metric: `http.server.request.duration` +#### Metric: `http.server.request.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -41,10 +41,7 @@ The time ends when: 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 ]. - -. - -##### Metric: `http.server.active_requests` +#### Metric: `http.server.active_requests` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | From 4acc4c302474c3a049ab076d9da8c39c41cbd3a0 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 13:11:24 -1000 Subject: [PATCH 18/21] react to feedback --- .../metrics/built-in/includes/built-in10.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 4d5b1bf68a83..520fcd62fdf5 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -60,7 +60,7 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT - [`aspnetcore.routing.match_attempts`](#metric-aspnetcoreroutingmatch_attempts) -##### Metric: `aspnetcore.routing.match_attempts` +#### Metric: `aspnetcore.routing.match_attempts` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -80,7 +80,7 @@ The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information fr - [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) -##### Metric: `aspnetcore.diagnostics.exceptions` +#### Metric: `aspnetcore.diagnostics.exceptions` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -104,7 +104,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information - [`aspnetcore.rate_limiting.request.time_in_queue`](#metric-aspnetcorerate_limitingrequesttime_in_queue) - [`aspnetcore.rate_limiting.requests`](#metric-aspnetcorerate_limitingrequests) -##### Metric: `aspnetcore.rate_limiting.active_request_leases` +#### Metric: `aspnetcore.rate_limiting.active_request_leases` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -116,7 +116,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information . -##### Metric: `aspnetcore.rate_limiting.request_lease.duration` +#### Metric: `aspnetcore.rate_limiting.request_lease.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -128,7 +128,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information . -##### Metric: `aspnetcore.rate_limiting.queued_requests` +#### Metric: `aspnetcore.rate_limiting.queued_requests` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -140,7 +140,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information . -##### Metric: `aspnetcore.rate_limiting.request.time_in_queue` +#### Metric: `aspnetcore.rate_limiting.request.time_in_queue` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -153,7 +153,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information . -##### Metric: `aspnetcore.rate_limiting.requests` +#### Metric: `aspnetcore.rate_limiting.requests` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -173,7 +173,7 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N - [`aspnetcore.header_parsing.parse_errors`](#metric-aspnetcoreheader_parsingparse_errors) - [`aspnetcore.header_parsing.cache_accesses`](#metric-aspnetcoreheader_parsingcache_accesses) -##### Metric: `aspnetcore.header_parsing.parse_errors` +#### Metric: `aspnetcore.header_parsing.parse_errors` | Name | Instrument Type | Unit (UCUM) | Description | |--|--|--|--| @@ -186,7 +186,7 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N . -##### Metric: `aspnetcore.header_parsing.cache_accesses` +#### Metric: `aspnetcore.header_parsing.cache_accesses` The metric is emitted only for HTTP request header parsers that support caching. @@ -214,7 +214,7 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa - [`kestrel.tls_handshake.duration`](#metric-kestreltls_handshakeduration) - [`kestrel.active_tls_handshakes`](#metric-kestrelactive_tls_handshakes) -##### Metric: `kestrel.active_connections` +#### Metric: `kestrel.active_connections` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -229,7 +229,7 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa . -##### Metric: `kestrel.connection.duration` +#### Metric: `kestrel.connection.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -252,7 +252,7 @@ Starting in .NET 9, when a connection ends with a known error, the `error.type` -##### Metric: `kestrel.rejected_connections` +#### Metric: `kestrel.rejected_connections` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -269,7 +269,7 @@ Connections are rejected when the currently active count exceeds the value confi . -##### Metric: `kestrel.queued_connections` +#### Metric: `kestrel.queued_connections` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -284,7 +284,7 @@ Connections are rejected when the currently active count exceeds the value confi . -##### Metric: `kestrel.queued_requests` +#### Metric: `kestrel.queued_requests` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -301,7 +301,7 @@ Connections are rejected when the currently active count exceeds the value confi . -##### Metric: `kestrel.upgraded_connections` +#### Metric: `kestrel.upgraded_connections` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -318,7 +318,7 @@ The counter only tracks HTTP/1.1 connections. . -##### Metric: `kestrel.tls_handshake.duration` +#### Metric: `kestrel.tls_handshake.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -337,7 +337,7 @@ When using OpenTelemetry, the default buckets for this metic are set to [ 0.005, . -##### Metric: `kestrel.active_tls_handshakes` +#### Metric: `kestrel.active_tls_handshakes` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -359,7 +359,7 @@ The `Microsoft.AspNetCore.Http.Connections` metrics report connection informatio - [`signalr.server.connection.duration`](#metric-signalrserverconnectionduration) - [`signalr.server.active_connections`](#metric-signalrserveractive_connections) -##### Metric: `signalr.server.connection.duration` +#### Metric: `signalr.server.connection.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -390,7 +390,7 @@ As this metric is tracking the connection duration, and ideally SignalR connecti . -##### Metric: `signalr.server.active_connections` +#### Metric: `signalr.server.active_connections` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | From 5339aab1110eb481a1572b50e574ffc09493f654 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 14:06:06 -1000 Subject: [PATCH 19/21] react to feedback --- .../metrics/built-in/includes/built-in10.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 520fcd62fdf5..bbf9e33bbb74 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -20,13 +20,13 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `http.route` | string | The matched route. | `{controller}/{action}/`
`{id?}`| If it's available. | +| `http.route` | string | The matched route. | `{controller}/{action}/{id?}`| If it's available. | | `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | | `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. | | `network.protocol.version` | string | Version of the protocol specified in `network.protocol.name`. | `3.1.1` | Always | | `url.scheme` | string | The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. | `http`; `https` | Always | -| `aspnetcore.request.`
`is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | +| `aspnetcore.request.is_unhandled` | Boolean | True when the request wasn't handled by the application pipeline. | `true` | If the request was unhandled. | The time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: @@ -68,8 +68,8 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.routing`
`.match_status` | string | Match result | `success`; `failure` | Always | -| `aspnetcore.routing.`
`is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | +| `aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always | +| `aspnetcore.routing.is_fallback_route` | boolean | A value that indicates whether the matched route is a fallback route. | `True` | If a route was successfully matched. | | `http.route` | string | The matched route | `{controller}/{action}/`
`{id?}` | If a route was successfully matched. | . @@ -84,12 +84,12 @@ The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information fr | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.diagnostics.`
`exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | +| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.diagnostics.`
`exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | -| `aspnetcore.diagnostics`
`.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | +| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always | +| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | | `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | . @@ -108,7 +108,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.`
`active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | +| [`aspnetcore.rate_limiting.active_request_leases`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingactive_request_leases) | UpDownCounter | `{request}` | Number of requests that are currently active on the server that hold a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -120,7 +120,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.`
`request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | +| [`aspnetcore.rate_limiting.request_lease.duration`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequest_leaseduration) | Histogram | `s` | The duration of the rate limiting lease held by requests on the server. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -132,7 +132,7 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.`
`queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.queued_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingqueued_requests) | UpDownCounter | `{request}` | Number of requests that are currently queued waiting to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| @@ -144,12 +144,12 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.`
`request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.request.time_in_queue`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequesttime_in_queue) | Histogram | `s` | The time a request spent in a queue waiting to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.rate_limiting.`
`policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.`
`result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | . @@ -157,12 +157,12 @@ The `Microsoft.AspNetCore.RateLimiting` metrics report rate limiting information | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| [`aspnetcore.rate_limiting.`
`requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | +| [`aspnetcore.rate_limiting.requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorerate_limitingrequests) | Counter | `{request}` | Number of requests that tried to acquire a rate limiting lease. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.rate_limiting.`
`policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | -| `aspnetcore.rate_limiting.`
`result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | +| `aspnetcore.rate_limiting.policy` | string | Rate limiting policy name. | `fixed`; `sliding`; `token` | If the matched endpoint for the request had a rate-limiting policy. | +| `aspnetcore.rate_limiting.result` | string | The rate limiting result shows whether lease was acquired or contains a rejection reason. | `acquired`; `request_canceled` | Always | . @@ -177,11 +177,11 @@ The `Microsoft.AspNetCore.HeaderParsing` metrics report information about [ASP.N | Name | Instrument Type | Unit (UCUM) | Description | |--|--|--|--| -| `aspnetcore.header_parsing.`
`parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | +| `aspnetcore.header_parsing.parse_errors` | Counter | `{parse_error}` | Number of errors that occurred when parsing HTTP request headers. | | Attribute | Type | Description | Examples | Presence | |--|--|--|--|--| -| `aspnetcore.header_parsing.`
`header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `error.type` | string | The error message. | `Unable to parse media type value.` | Always | . @@ -192,11 +192,11 @@ The metric is emitted only for HTTP request header parsers that support caching. | Name | Instrument Type | Unit (UCUM) | Description | | ---- | --------------- | ----------- | ----------- | -| `aspnetcore.header_parsing.`
`cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | +| `aspnetcore.header_parsing.cache_accesses` | Counter | `{cache_access}` | Number of times a cache storing parsed header values was accessed. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.header_parsing.`
`header.name` | string | The header name. | `Content-Type` | Always | +| `aspnetcore.header_parsing.header.name` | string | The header name. | `Content-Type` | Always | | `aspnetcore.header_parsing.cache_access.type` | string | A value indicating whether the header's value was found in the cache or not. | `Hit`; `Miss` | Always | . From 45677a284a9dc2575ef0d07a0a24f47b2d372672 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:44:46 -1000 Subject: [PATCH 20/21] react to feedback --- .../log-mon/metrics/built-in/includes/built-in10.md | 4 +--- .../log-mon/metrics/built-in/includes/built-in8.md | 10 +++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index bbf9e33bbb74..d60e68579b4f 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -248,9 +248,7 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa 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. -Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). - - +When a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). #### Metric: `kestrel.rejected_connections` diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md index 0c99f637d5d3..70efbbf48fbf 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in8.md @@ -228,7 +228,15 @@ The `Microsoft.AspNetCore.Server.Kestrel` metrics report HTTP connection informa 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. -Starting in .NET 9, when a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). +:::moniker-end + +:::moniker range="= aspnetcore-9.0" + +When a connection ends with a known error, the `error.type` attribute value is set to the known error type. Known connection errors can be found at [Semantic Conventions for Kestrel web server metrics](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/). + +:::moniker-end + +:::moniker range=">= aspnetcore-8.0 < aspnetcore-10.0" ##### Metric: `kestrel.rejected_connections` From 078d9e5174226bd1e6ba6f28ccbce2407231502b Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:48:23 -1000 Subject: [PATCH 21/21] react to feedback --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index d60e68579b4f..367dc420ff10 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -20,7 +20,7 @@ The `Microsoft.AspNetCore.Hosting` metrics report high-level information about H | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `http.route` | string | The matched route. | `{controller}/{action}/{id?}`| If it's available. | +| `http.route` | string | The matched route. | `{controller}/{action}/`
`{id?}`| If it's available. | | `error.type` | string | Describes a class of error the operation ended with. | `timeout`; `name_resolution_error`; `500` | If request has ended with an error. | | `http.request.method` | string | HTTP request method. | `GET`; `POST`; `HEAD` | Always | | `http.response.status_code` | int | [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). | `200` | If one was sent. |