From b9122d9b4320f45fd5cc0e4746320632b3e726d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 03:28:37 +0000 Subject: [PATCH 01/16] Initial plan From 0d12779456d6a15fd2a1d4cc551d4ba088b83265 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 03:34:00 +0000 Subject: [PATCH 02/16] Split built-in metrics page into focused topic pages Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> --- .../kestrel/security-considerations.md | 2 +- .../log-mon/metrics/built-in-components.md | 137 ++++ .../log-mon/metrics/built-in-diagnostics.md | 41 ++ aspnetcore/log-mon/metrics/built-in-http.md | 365 +++++++++++ .../log-mon/metrics/built-in-security.md | 107 ++++ aspnetcore/log-mon/metrics/built-in.md | 583 +----------------- aspnetcore/release-notes/aspnetcore-10.0.md | 2 +- aspnetcore/toc.yml | 9 + 8 files changed, 687 insertions(+), 559 deletions(-) create mode 100644 aspnetcore/log-mon/metrics/built-in-components.md create mode 100644 aspnetcore/log-mon/metrics/built-in-diagnostics.md create mode 100644 aspnetcore/log-mon/metrics/built-in-http.md create mode 100644 aspnetcore/log-mon/metrics/built-in-security.md diff --git a/aspnetcore/fundamentals/servers/kestrel/security-considerations.md b/aspnetcore/fundamentals/servers/kestrel/security-considerations.md index 358fd3b4557e..51d1d5107671 100644 --- a/aspnetcore/fundamentals/servers/kestrel/security-considerations.md +++ b/aspnetcore/fundamentals/servers/kestrel/security-considerations.md @@ -674,7 +674,7 @@ Beyond rejection-specific signals, Kestrel emits a set of built-in metrics under These metrics integrate with OpenTelemetry, `dotnet-counters`, Prometheus exporters, and Azure Monitor. For full setup guidance, see: - [ASP.NET Core metrics overview](xref:log-mon/metrics/metrics) -- [Kestrel built-in metrics reference](/aspnet/core/log-mon/metrics/built-in#microsoftaspnetcoreserverkestrel) +- [Kestrel built-in metrics reference](xref:log-mon/metrics/built-in-http#microsoftaspnetcoreserverkestrel) ### TLS-over-HTTP detection diff --git a/aspnetcore/log-mon/metrics/built-in-components.md b/aspnetcore/log-mon/metrics/built-in-components.md new file mode 100644 index 000000000000..ae9f8e2ede05 --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in-components.md @@ -0,0 +1,137 @@ +--- +title: ASP.NET Core built-in Blazor (Components) metrics +ai-usage: ai-assisted +author: guardrex +description: Learn about built-in Blazor (Components) metrics for ASP.NET Core apps, including component, lifecycle, and server circuit metrics. +monikerRange: '>= aspnetcore-10.0' +ms.author: wpickett +ms.date: 08/05/2026 +ms.topic: reference +uid: log-mon/metrics/built-in-components +--- +# ASP.NET Core built-in Blazor (Components) metrics + +This article describes the built-in Blazor (Components) metrics for ASP.NET Core produced using the API. These metrics cover Razor component route changes and browser events, component lifecycle events, and server-side Blazor circuits. They're available in ASP.NET Core 10.0 or later. + +For an overview of all built-in metrics reference pages and how to read this reference, see . For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . + +## `Microsoft.AspNetCore.Components` + +The `Microsoft.AspNetCore.Components` metrics report information on Razor component route changes and browser events: + +* [`aspnetcore.components.navigation`](#metric-aspnetcorecomponentsnavigation) +* [`aspnetcore.components.event_handler`](#metric-aspnetcorecomponentsevent_handler) + +### Metric: `aspnetcore.components.navigation` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.navigation` | Counter | `{route}` | Tracks the total number of route changes in the app. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.components.type` | string | Component navigated to. | `TestComponent` | Always +`aspnetcore.components.route` | string | The component's route. | `/test-route` | Always +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. + +Usage: How many different Blazor pages did users visit? + +### Metric: `aspnetcore.components.event_handler` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.event_handler` | Histogram | `s` | Measures the duration of processing browser events, including business logic of the component, excluding the duration of child component event handling. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always +`aspnetcore.components.method` | string | C# method handling the event. | `OnClick` | Always +`aspnetcore.components.attribute.name` | string | Component attribute name handling the event. | `onclick` | Always +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. + +Usage: + +* Which component's click event handler is slow? +* Which buttons are selected often? + +## `Microsoft.AspNetCore.Components.Lifecycle` + +The `Microsoft.AspNetCore.Components.Lifecycle` metrics report information on Razor component lifecycle events: + +* [`aspnetcore.components.update_parameters`](#metric-aspnetcorecomponentsupdate_parameters) +* [`aspnetcore.components.render_diff`](#metric-aspnetcorecomponentsrender_diff) + +### Metric: `aspnetcore.components.update_parameters` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.update_parameters` | Histogram | `s` | Measures the duration of processing component parameters, including business logic. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. + +Usage: + +* Which components are slow to update? +* Which components are updated often? + +### Metric: `aspnetcore.components.render_diff` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.render_diff` | Histogram | `s` | Tracks the duration of rendering batches. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.components.diff.length` | int | The length of the render diff/size of the batch (bucketed). | 50 | Always +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. + +Usage: + +* Is server rendering slow? +* Do I render diffs that are too large? (network bandwidth, DOM update) + +## `Microsoft.AspNetCore.Components.Server.Circuits` + +The `Microsoft.AspNetCore.Components.Server.Circuits` metrics report information on server-side Blazor circuits in Blazor Server and Blazor Web Apps: + +* [`aspnetcore.components.circuit.active`](#metric-aspnetcorecomponentscircuitactive) +* [`aspnetcore.components.circuit.connected`](#metric-aspnetcorecomponentscircuitconnected) +* [`aspnetcore.components.circuit.duration`](#metric-aspnetcorecomponentscircuitduration) + +### Metric: `aspnetcore.components.circuit.active` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.circuit.active` | UpDownCounter | `{circuit}` | Shows the number of active circuits currently in memory. + +Usage: How much memory does the session state hold? + +### Metric: `aspnetcore.components.circuit.connected` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.circuit.connected` | UpDownCounter | `{circuit}` | Tracks the number of circuits connected to clients. + +Usage: How many SignalR connections are open? + +### Metric: `aspnetcore.components.circuit.duration` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.components.circuit.duration` | Histogram | `s` | Measures circuit lifetime duration and provides total circuit count. + +Usage: + +* How many sessions processed? +* How long do users keep the session/tab open? + +## See also + +* +* +* +* +* diff --git a/aspnetcore/log-mon/metrics/built-in-diagnostics.md b/aspnetcore/log-mon/metrics/built-in-diagnostics.md new file mode 100644 index 000000000000..bf25dbe1b3af --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in-diagnostics.md @@ -0,0 +1,41 @@ +--- +title: ASP.NET Core built-in diagnostics metrics +ai-usage: ai-assisted +author: guardrex +description: Learn about built-in diagnostics metrics for ASP.NET Core apps, reported by the error handling middleware. +ms.author: wpickett +ms.date: 08/05/2026 +ms.topic: reference +uid: log-mon/metrics/built-in-diagnostics +--- +# ASP.NET Core built-in diagnostics metrics + +This article describes the built-in diagnostics metrics for ASP.NET Core produced using the API. These metrics report diagnostics information from the ASP.NET Core error handling middleware. + +For an overview of all built-in metrics reference pages and how to read this reference, see . For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . + +## `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 + +## See also + +* +* +* +* +* diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md new file mode 100644 index 000000000000..a7e1ab31f18f --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -0,0 +1,365 @@ +--- +title: ASP.NET Core built-in HTTP metrics +ai-usage: ai-assisted +author: guardrex +description: Learn about built-in HTTP metrics for ASP.NET Core apps, including hosting, routing, rate limiting, header parsing, Kestrel, and SignalR. +ms.author: wpickett +ms.date: 08/05/2026 +ms.topic: reference +uid: log-mon/metrics/built-in-http +--- +# ASP.NET Core built-in HTTP metrics + +This article describes the built-in HTTP-related metrics for ASP.NET Core produced using the API. These metrics cover hosting, routing, rate limiting, header parsing, the Kestrel web server, and SignalR. + +For an overview of all built-in metrics reference pages and how to read this reference, see . For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . + +## `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-httpserverrequestduration) | 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 ]. + +### 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-httpserveractive_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 + +## `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. + +## `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. + +### 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. + +### 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. + +### 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 + +### 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 + +## `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 + +### 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 + +## `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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type`| string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. + +### 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://www.geeksforgeeks.org/application-layer-in-osi-model/) 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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. + +:::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 + +### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. + +### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. + +### 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://www.geeksforgeeks.org/application-layer-in-osi-model/) 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. + +### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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. + +### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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 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: `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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always +`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. + +## `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 + +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 | Description +--- | --- +`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. + +### 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 + +## See also + +* +* +* +* +* diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md new file mode 100644 index 000000000000..651da69ecd5b --- /dev/null +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -0,0 +1,107 @@ +--- +title: ASP.NET Core built-in authentication, authorization, and Identity metrics +ai-usage: ai-assisted +author: guardrex +description: Learn about built-in authentication, authorization, and Identity metrics for ASP.NET Core apps. +monikerRange: '>= aspnetcore-10.0' +ms.author: wpickett +ms.date: 08/05/2026 +ms.topic: reference +uid: log-mon/metrics/built-in-security +--- +# ASP.NET Core built-in authentication, authorization, and Identity metrics + +This article describes the built-in authentication, authorization, and Identity metrics for ASP.NET Core produced using the API. These metrics cover authorization attempts and authentication operations. They're available in ASP.NET Core 10.0 or later. + +For an overview of all built-in metrics reference pages and how to read this reference, see . For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . + +## `Microsoft.AspNetCore.Authorization` + +The `Microsoft.AspNetCore.Authorization` metrics report information about [Authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: + +### Metric: `aspnetcore.authorization.attempts` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authorization.attempts` | Counter | `{request}` | The total number of requests for which authorization was attempted. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`user.is_authenticated` | boolean | Whether the request came from an authenticated user | `true` | `Required` +`aspnetcore.authorization.policy` | string | The name of the authorization policy. | `AtLeast21`; `EmployeeOnly` | `Conditionally required` if an authorization policy is used. +`aspnetcore.authorization.result` | string | Whether the authorization succeeded or failed. | `success`; `failure` | `Conditionally Required` if an exception is not thrown during authorization. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. + +## `Microsoft.AspNetCore.Authentication` + +The `Microsoft.AspNetCore.Authentication` metrics report information about [Authentication](xref:security/authentication/index) in ASP.NET Core apps: + +* [`aspnetcore.authentication.authenticate.duration`](#metric-aspnetcoreauthenticationauthenticateduration) +* [`aspnetcore.authentication.challenges`](#metric-aspnetcoreauthenticationchallenges) +* [`aspnetcore.authentication.forbids`](#metric-aspnetcoreauthenticationforbids) +* [`aspnetcore.authentication.sign_ins`](#metric-aspnetcoreauthenticationsign_ins) +* [`aspnetcore.authentication.sign_outs`](#metric-aspnetcoreauthenticationsign_outs) + +### Metric: `aspnetcore.authentication.authenticate.duration` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authentication.authenticate.duration` | Histogram | `s` | The authentication duration for a request. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.authentication.result` | string | The authentication result. | `success`; `failure`; `none`; `_OTHER` | `Conditionally Required` if the request did not end with an error. +`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if authentication failed or the request. has ended with an error. + +### Metric: `aspnetcore.authentication.challenges` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authentication.challenges` | Counter | `{request}` | The total number of times a scheme is challenged. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. + +### Metric: `aspnetcore.authentication.forbids` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authentication.forbids` | Counter | `{request}` | The total number of times an authenticated user attempts to access a resource they aren't permitted to access. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. + +### Metric: `aspnetcore.authentication.sign_ins` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authentication.sign_ins` | Counter | `{request}` | The total number of times a principal is signed in with a scheme. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. + +### Metric: `aspnetcore.authentication.sign_outs` + +Name | Instrument Type | Unit (UCUM) | Description +--- | --- | --- | --- +`aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a principal is signed out with a scheme. + +Attribute | Type | Description | Examples | Presence +--- | --- | --- | --- | --- +`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. + +## See also + +* +* +* +* +* diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index e58fb6dcb627..fece8cd0e503 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -1,579 +1,48 @@ --- title: ASP.NET Core built-in metrics +ai-usage: ai-assisted description: Learn about built-in metrics for ASP.NET Core apps. author: guardrex ms.author: wpickett -ms.date: 7/7/2025 +ms.date: 08/05/2026 ms.topic: reference uid: log-mon/metrics/built-in --- # ASP.NET Core built-in metrics -This article describes the built-in metrics 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). +This article is the entry point for the built-in metrics that ASP.NET Core produces using the API. The metrics reference is organized into focused pages by topic. Use the following pages to find the instruments, attributes, and usage guidance for each area. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters). For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . -:::moniker range=">= aspnetcore-10.0" +## Metrics reference pages -## `Microsoft.AspNetCore.Components` +Page | Namespaces | Example metrics +--- | --- | --- +[HTTP metrics](xref:log-mon/metrics/built-in-http) | `Microsoft.AspNetCore.Hosting`, `Microsoft.AspNetCore.Routing`, `Microsoft.AspNetCore.RateLimiting`, `Microsoft.AspNetCore.HeaderParsing`, `Microsoft.AspNetCore.Server.Kestrel`, `Microsoft.AspNetCore.Http.Connections` (SignalR) | `http.server.request.duration`, `aspnetcore.routing.match_attempts`, `kestrel.active_connections`, `signalr.server.active_connections` +[Diagnostics metrics](xref:log-mon/metrics/built-in-diagnostics) | `Microsoft.AspNetCore.Diagnostics` | `aspnetcore.diagnostics.exceptions` +[Blazor (Components) metrics](xref:log-mon/metrics/built-in-components) | `Microsoft.AspNetCore.Components`, `Microsoft.AspNetCore.Components.Lifecycle`, `Microsoft.AspNetCore.Components.Server.Circuits` | `aspnetcore.components.navigation`, `aspnetcore.components.circuit.active` +[Authentication, authorization, and Identity metrics](xref:log-mon/metrics/built-in-security) | `Microsoft.AspNetCore.Authorization`, `Microsoft.AspNetCore.Authentication` | `aspnetcore.authorization.attempts`, `aspnetcore.authentication.challenges` -The `Microsoft.AspNetCore.Components` metrics report information on Razor component route changes and browser events: +The Blazor (Components) and authentication, authorization, and Identity metrics pages describe metrics available in ASP.NET Core 10.0 or later. Select .NET 10.0 (or a later version) with the version selector to view that content. -* [`aspnetcore.components.navigation`](#metric-aspnetcorecomponentsnavigation) -* [`aspnetcore.components.event_handler`](#metric-aspnetcorecomponentsevent_handler) +## How metrics are grouped -### Metric: `aspnetcore.components.navigation` +Metrics are grouped by audience and topic. Because some namespaces don't map cleanly to a single topic, the following placement rules apply: -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.navigation` | Counter | `{route}` | Tracks the total number of route changes in the app. +* HTTP request handling, routing, rate limiting, header parsing, the Kestrel web server, and SignalR (`Microsoft.AspNetCore.Http.Connections`) are grouped together on the HTTP metrics page, because they all relate to serving HTTP and real-time connections. +* Error handling middleware metrics are on the diagnostics metrics page. +* Blazor (Components) metrics are grouped by their component, lifecycle, and server circuit namespaces. +* Authentication, authorization, and Identity metrics are grouped together as security-related metrics. -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.components.type` | string | Component navigated to. | `TestComponent` | Always -`aspnetcore.components.route` | string | The component's route. | `/test-route` | Always -`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. +## How to read this reference -Usage: How many different Blazor pages did users visit? +Each metric on the reference pages is documented with the following information: -### Metric: `aspnetcore.components.event_handler` +* **Name**: The metric (instrument) name. +* **Instrument Type**: The kind of instrument, such as `Counter`, `UpDownCounter`, or `Histogram`. +* **Unit (UCUM)**: The unit of measurement, expressed using the [Unified Code for Units of Measure (UCUM)](https://ucum.org/), for example `s` for seconds. +* **Attribute**: The dimensions (tags) reported with the metric. +* **Presence**: When the attribute is present, for example `Always` or only under specific conditions. +* **Usage**: Example questions the metric helps answer. -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.event_handler` | Histogram | `s` | Measures the duration of processing browser events, including business logic of the component, excluding the duration of child component event handling. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always -`aspnetcore.components.method` | string | C# method handling the event. | `OnClick` | Always -`aspnetcore.components.attribute.name` | string | Component attribute name handling the event. | `onclick` | Always -`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. - -Usage: - -* Which component's click event handler is slow? -* Which buttons are selected often? - -## `Microsoft.AspNetCore.Components.Lifecycle` - -The `Microsoft.AspNetCore.Components.Lifecycle` metrics report information on Razor component lifecycle events: - -* [`aspnetcore.components.update_parameters`](#metric-aspnetcorecomponentsupdate_parameters) -* [`aspnetcore.components.render_diff`](#metric-aspnetcorecomponentsrender_diff) - -### Metric: `aspnetcore.components.update_parameters` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.update_parameters` | Histogram | `s` | Measures the duration of processing component parameters, including business logic. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always -`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. - -Usage: - -* Which components are slow to update? -* Which components are updated often? - -### Metric: `aspnetcore.components.render_diff` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.render_diff` | Histogram | `s` | Tracks the duration of rendering batches. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.components.diff.length` | int | The length of the render diff/size of the batch (bucketed). | 50 | Always -`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. - -Usage: - -* Is server rendering slow? -* Do I render diffs that are too large? (network bandwidth, DOM update) - -## `Microsoft.AspNetCore.Components.Server.Circuits` - -The `Microsoft.AspNetCore.Components.Server.Circuits` metrics report information on server-side Blazor circuits in Blazor Server and Blazor Web Apps: - -* [`aspnetcore.components.circuit.active`](#metric-aspnetcorecomponentscircuitactive) -* [`aspnetcore.components.circuit.connected`](#metric-aspnetcorecomponentscircuitconnected) -* [`aspnetcore.components.circuit.duration`](#metric-aspnetcorecomponentscircuitduration) - -### Metric: `aspnetcore.components.circuit.active` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.circuit.active` | UpDownCounter | `{circuit}` | Shows the number of active circuits currently in memory. - -Usage: How much memory does the session state hold? - -### Metric: `aspnetcore.components.circuit.connected` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.circuit.connected` | UpDownCounter | `{circuit}` | Tracks the number of circuits connected to clients. - -Usage: How many SignalR connections are open? - -### Metric: `aspnetcore.components.circuit.duration` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.components.circuit.duration` | Histogram | `s` | Measures circuit lifetime duration and provides total circuit count. - -Usage: - -* How many sessions processed? -* How long do users keep the session/tab open? - -:::moniker-end - -## `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-httpserverrequestduration) | 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 ]. - -### 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-httpserveractive_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 - -## `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. - -## `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 - -## `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. - -### 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. - -### 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. - -### 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 - -### 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 - -## `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 - -### 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 - -## `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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type`| string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. - -### 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://www.geeksforgeeks.org/application-layer-in-osi-model/) 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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. - -:::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 - -### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. - -### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. - -### 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://www.geeksforgeeks.org/application-layer-in-osi-model/) 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. - -### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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. - -### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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 ]. - -### 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://www.geeksforgeeks.org/transport-layer-in-osi-model/) or [inter-process communication method](https://en.wikipedia.org/wiki/Inter-process_communication). | `tcp`; `unix` | Always -`network.type` | string | [OSI network layer](https://www.geeksforgeeks.org/network-layer-in-osi-model/) 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`. - -## `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 - -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 | Description ---- | --- -`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. - -### 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 - -:::moniker range=">= aspnetcore-10.0" - -## `Microsoft.AspNetCore.Authorization` - -The `Microsoft.AspNetCore.Authorization` metrics report information about [Authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: - -### Metric: `aspnetcore.authorization.attempts` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authorization.attempts` | Counter | `{request}` | The total number of requests for which authorization was attempted. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`user.is_authenticated` | boolean | Whether the request came from an authenticated user | `true` | `Required` -`aspnetcore.authorization.policy` | string | The name of the authorization policy. | `AtLeast21`; `EmployeeOnly` | `Conditionally required` if an authorization policy is used. -`aspnetcore.authorization.result` | string | Whether the authorization succeeded or failed. | `success`; `failure` | `Conditionally Required` if an exception is not thrown during authorization. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. - -## `Microsoft.AspNetCore.Authentication` - -The `Microsoft.AspNetCore.Authentication` metrics report information about [Authentication](xref:security/authentication/index) in ASP.NET Core apps: - -* [`aspnetcore.authentication.authenticate.duration`](#metric-aspnetcoreauthenticationauthenticateduration) -* [`aspnetcore.authentication.challenges`](#metric-aspnetcoreauthenticationchallenges) -* [`aspnetcore.authentication.forbids`](#metric-aspnetcoreauthenticationforbids) -* [`aspnetcore.authentication.sign_ins`](#metric-aspnetcoreauthenticationsign_ins) -* [`aspnetcore.authentication.sign_outs`](#metric-aspnetcoreauthenticationsign_outs) - -### Metric: `aspnetcore.authentication.authenticate.duration` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authentication.authenticate.duration` | Histogram | `s` | The authentication duration for a request. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.authentication.result` | string | The authentication result. | `success`; `failure`; `none`; `_OTHER` | `Conditionally Required` if the request did not end with an error. -`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if authentication failed or the request. has ended with an error. - -### Metric: `aspnetcore.authentication.challenges` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authentication.challenges` | Counter | `{request}` | The total number of times a scheme is challenged. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. - -### Metric: `aspnetcore.authentication.forbids` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authentication.forbids` | Counter | `{request}` | The total number of times an authenticated user attempts to access a resource they aren't permitted to access. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. - -### Metric: `aspnetcore.authentication.sign_ins` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authentication.sign_ins` | Counter | `{request}` | The total number of times a principal is signed in with a scheme. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. - -### Metric: `aspnetcore.authentication.sign_outs` - -Name | Instrument Type | Unit (UCUM) | Description ---- | --- | --- | --- -`aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a principal is signed out with a scheme. - -Attribute | Type | Description | Examples | Presence ---- | --- | --- | --- | --- -`aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. - -:::moniker-end +For guidance on how to collect, report, enrich, and test with these metrics, see . diff --git a/aspnetcore/release-notes/aspnetcore-10.0.md b/aspnetcore/release-notes/aspnetcore-10.0.md index 5e0a9e60327a..7a34601cb336 100644 --- a/aspnetcore/release-notes/aspnetcore-10.0.md +++ b/aspnetcore/release-notes/aspnetcore-10.0.md @@ -90,7 +90,7 @@ The following image shows an example of the Authenticated request duration metri ![Authenticated request duration in the Aspire dashboard](https://github.com/user-attachments/assets/170615e9-ef25-48a1-a482-4933e2e03f03) -For more information, see . +For more information, see . [!INCLUDE[](~/release-notes/aspnetcore-10/includes/identity-metrics.md)] diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 2b39f43589e2..708fddc82460 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -551,6 +551,15 @@ items: uid: log-mon/metrics/metrics - name: Built-in metrics uid: log-mon/metrics/built-in + items: + - name: HTTP metrics + uid: log-mon/metrics/built-in-http + - name: Diagnostics metrics + uid: log-mon/metrics/built-in-diagnostics + - name: Blazor (Components) metrics + uid: log-mon/metrics/built-in-components + - name: Authentication, authorization, and Identity metrics + uid: log-mon/metrics/built-in-security - name: HttpContext uid: fundamentals/use-httpcontext - name: Routing From 2261cc9d8bcfff69cf65de38320c43c938c5ece2 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:44:32 -0700 Subject: [PATCH 03/16] Apply suggestion from @wadepickett --- aspnetcore/log-mon/metrics/built-in-security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index 651da69ecd5b..a71fee9ecdb2 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -52,7 +52,7 @@ Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- `aspnetcore.authentication.result` | string | The authentication result. | `success`; `failure`; `none`; `_OTHER` | `Conditionally Required` if the request did not end with an error. `aspnetcore.authentication.scheme` | string | The name of the authentication scheme. | `Bearer`; `Cookies` | `Conditionally Required` if the request did not end with an error. -`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if authentication failed or the request. has ended with an error. +`error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if authentication failed or the request has ended with an error. ### Metric: `aspnetcore.authentication.challenges` From afc092c26571af101e489ac8da690d02ad2b9318 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:49:12 -0700 Subject: [PATCH 04/16] Apply suggestions from code review Co-authored-by: Wade Pickett --- aspnetcore/log-mon/metrics/built-in-http.md | 2 +- aspnetcore/log-mon/metrics/built-in-security.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index a7e1ab31f18f..27361f4c7dd2 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -54,7 +54,7 @@ When using OpenTelemetry, the default buckets for this metric are set to [ 0.005 Name | Instrument Type | Unit (UCUM) | Description --- | --- | --- | --- -[`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpserveractive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in-flight. +[`http.server.active_requests`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-httpserveractive_requests) | UpDownCounter | `{request}` | Measures the number of concurrent HTTP requests that are currently in flight. Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index a71fee9ecdb2..c5069155ed71 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -17,7 +17,7 @@ For an overview of all built-in metrics reference pages and how to read this ref ## `Microsoft.AspNetCore.Authorization` -The `Microsoft.AspNetCore.Authorization` metrics report information about [Authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: +The `Microsoft.AspNetCore.Authorization` metrics report information about [authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: ### Metric: `aspnetcore.authorization.attempts` @@ -27,7 +27,7 @@ Name | Instrument Type | Unit (UCUM) | Description Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- -`user.is_authenticated` | boolean | Whether the request came from an authenticated user | `true` | `Required` +`user.is_authenticated` | boolean | Whether the request came from an authenticated user. | `true` | `Required` `aspnetcore.authorization.policy` | string | The name of the authorization policy. | `AtLeast21`; `EmployeeOnly` | `Conditionally required` if an authorization policy is used. `aspnetcore.authorization.result` | string | Whether the authorization succeeded or failed. | `success`; `failure` | `Conditionally Required` if an exception is not thrown during authorization. `error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error. From e259aa54b60f919e9dd61b538a829f82c62e73d1 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:56:14 -0700 Subject: [PATCH 05/16] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- aspnetcore/toc.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 708fddc82460..0e5078dbee66 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -552,14 +552,14 @@ items: - name: Built-in metrics uid: log-mon/metrics/built-in items: - - name: HTTP metrics - uid: log-mon/metrics/built-in-http - - name: Diagnostics metrics - uid: log-mon/metrics/built-in-diagnostics - - name: Blazor (Components) metrics - uid: log-mon/metrics/built-in-components - - name: Authentication, authorization, and Identity metrics - uid: log-mon/metrics/built-in-security + - name: HTTP metrics + uid: log-mon/metrics/built-in-http + - name: Diagnostics metrics + uid: log-mon/metrics/built-in-diagnostics + - name: Blazor (Components) metrics + uid: log-mon/metrics/built-in-components + - name: Authentication, authorization, and Identity metrics + uid: log-mon/metrics/built-in-security - name: HttpContext uid: fundamentals/use-httpcontext - name: Routing From 993219cf059f1e94b3e7a0574f69ddad8ffecf38 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:56:29 -0700 Subject: [PATCH 06/16] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index fece8cd0e503..7ea9452623c4 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -1,8 +1,8 @@ --- title: ASP.NET Core built-in metrics ai-usage: ai-assisted -description: Learn about built-in metrics for ASP.NET Core apps. author: guardrex +description: Learn about built-in metrics for ASP.NET Core apps. ms.author: wpickett ms.date: 08/05/2026 ms.topic: reference From b159b1a28baf5e463056e0ce49dabe01b93e3ce8 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:56:49 -0700 Subject: [PATCH 07/16] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in-http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index 27361f4c7dd2..99e313cfefd0 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -35,7 +35,7 @@ Attribute | Type | Description | Examples | Presence `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 80b89bf7a46563bf5ecb5bf1cd003ec4eae1053f Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 20:57:08 -0700 Subject: [PATCH 08/16] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in-http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index 99e313cfefd0..594cd69c1470 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -215,7 +215,7 @@ Attribute | Type | Description | Examples | Presence `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. +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. :::moniker range="= aspnetcore-9.0" From 30511e18b07a3b5da345e96fd6f62bf72de5bc83 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:01:58 -0700 Subject: [PATCH 09/16] Document aspnetcore.authorization.attempts metric Add information about authorization attempts metric in ASP.NET Core. --- aspnetcore/log-mon/metrics/built-in-security.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index c5069155ed71..50d0d96b556c 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -19,6 +19,8 @@ For an overview of all built-in metrics reference pages and how to read this ref The `Microsoft.AspNetCore.Authorization` metrics report information about [authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: +* [`aspnetcore.authorization.attempts`](#metric-aspnetcoreauthorizationattempts) + ### Metric: `aspnetcore.authorization.attempts` Name | Instrument Type | Unit (UCUM) | Description From f8d7804432a5ccd3484e88f1f2c24df75207fc49 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:02:28 -0700 Subject: [PATCH 10/16] Apply suggestion from @wadepickett --- aspnetcore/log-mon/metrics/built-in-diagnostics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-diagnostics.md b/aspnetcore/log-mon/metrics/built-in-diagnostics.md index bf25dbe1b3af..57fb6a685027 100644 --- a/aspnetcore/log-mon/metrics/built-in-diagnostics.md +++ b/aspnetcore/log-mon/metrics/built-in-diagnostics.md @@ -28,7 +28,7 @@ Name | Instrument Type | Unit (UCUM) | Description Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- -`aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result | `handled`; `unhandled` | Always +`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 From 45493ec221011da333f48fcb5b803b039dd31282 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:04:32 -0700 Subject: [PATCH 11/16] Apply suggestions from code review Co-authored-by: Wade Pickett --- aspnetcore/log-mon/metrics/built-in-http.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index 594cd69c1470..abcb2daedf45 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -75,9 +75,9 @@ Name | Instrument Type | Unit (UCUM) | Description Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- -`aspnetcore.routing.match_status` | string | Match result | `success`; `failure` | Always +`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. +`http.route` | string | The matched route. | `{controller}/{action}/`
`{id?}` | If a route was successfully matched. ## `Microsoft.AspNetCore.RateLimiting` From b3ed88ca6cbff76c539609af0e8a407a105de0e6 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:18:32 -0700 Subject: [PATCH 12/16] Apply suggestions from code review Co-authored-by: Wade Pickett --- aspnetcore/log-mon/metrics/built-in-security.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index 50d0d96b556c..7dfdae3f15e9 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -1,5 +1,5 @@ --- -title: ASP.NET Core built-in authentication, authorization, and Identity metrics +title: ASP.NET Core built-in authentication and authorization metrics ai-usage: ai-assisted author: guardrex description: Learn about built-in authentication, authorization, and Identity metrics for ASP.NET Core apps. @@ -9,9 +9,9 @@ ms.date: 08/05/2026 ms.topic: reference uid: log-mon/metrics/built-in-security --- -# ASP.NET Core built-in authentication, authorization, and Identity metrics +# ASP.NET Core built-in authentication and authorization metrics -This article describes the built-in authentication, authorization, and Identity metrics for ASP.NET Core produced using the API. These metrics cover authorization attempts and authentication operations. They're available in ASP.NET Core 10.0 or later. +This article describes the built-in authentication and authorization metrics for ASP.NET Core produced using the API. These metrics cover authorization attempts and authentication operations. They're available in ASP.NET Core 10.0 or later. For an overview of all built-in metrics reference pages and how to read this reference, see . For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see . From 6b440ade37119cd377714eea61fdcb5ef867c9da Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:21:44 -0700 Subject: [PATCH 13/16] Apply suggestion from @wadepickett --- aspnetcore/log-mon/metrics/built-in-security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index 7dfdae3f15e9..3acef2e4cd5a 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -2,7 +2,7 @@ title: ASP.NET Core built-in authentication and authorization metrics ai-usage: ai-assisted author: guardrex -description: Learn about built-in authentication, authorization, and Identity metrics for ASP.NET Core apps. +description: Learn about built-in authentication and authorization metrics for ASP.NET Core apps. monikerRange: '>= aspnetcore-10.0' ms.author: wpickett ms.date: 08/05/2026 From 9b008053f11a5c849edb71761e43c98661d946d7 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:29:15 -0700 Subject: [PATCH 14/16] Apply suggestions from code review Co-authored-by: Wade Pickett --- aspnetcore/log-mon/metrics/built-in.md | 4 ++-- aspnetcore/toc.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in.md b/aspnetcore/log-mon/metrics/built-in.md index 7ea9452623c4..bc041c7c1df4 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -21,9 +21,9 @@ Page | Namespaces | Example metrics [HTTP metrics](xref:log-mon/metrics/built-in-http) | `Microsoft.AspNetCore.Hosting`, `Microsoft.AspNetCore.Routing`, `Microsoft.AspNetCore.RateLimiting`, `Microsoft.AspNetCore.HeaderParsing`, `Microsoft.AspNetCore.Server.Kestrel`, `Microsoft.AspNetCore.Http.Connections` (SignalR) | `http.server.request.duration`, `aspnetcore.routing.match_attempts`, `kestrel.active_connections`, `signalr.server.active_connections` [Diagnostics metrics](xref:log-mon/metrics/built-in-diagnostics) | `Microsoft.AspNetCore.Diagnostics` | `aspnetcore.diagnostics.exceptions` [Blazor (Components) metrics](xref:log-mon/metrics/built-in-components) | `Microsoft.AspNetCore.Components`, `Microsoft.AspNetCore.Components.Lifecycle`, `Microsoft.AspNetCore.Components.Server.Circuits` | `aspnetcore.components.navigation`, `aspnetcore.components.circuit.active` -[Authentication, authorization, and Identity metrics](xref:log-mon/metrics/built-in-security) | `Microsoft.AspNetCore.Authorization`, `Microsoft.AspNetCore.Authentication` | `aspnetcore.authorization.attempts`, `aspnetcore.authentication.challenges` +[Authentication and authorization metrics](xref:log-mon/metrics/built-in-security) | `Microsoft.AspNetCore.Authorization`, `Microsoft.AspNetCore.Authentication` | `aspnetcore.authorization.attempts`, `aspnetcore.authentication.challenges` -The Blazor (Components) and authentication, authorization, and Identity metrics pages describe metrics available in ASP.NET Core 10.0 or later. Select .NET 10.0 (or a later version) with the version selector to view that content. +The Blazor (Components) and authentication and authorization metrics pages describe metrics available in ASP.NET Core 10.0 or later. Select ASP.NET Core 10.0 (or a later version) with the version selector to view that content. ## How metrics are grouped diff --git a/aspnetcore/toc.yml b/aspnetcore/toc.yml index 0e5078dbee66..d813b61a5e66 100644 --- a/aspnetcore/toc.yml +++ b/aspnetcore/toc.yml @@ -558,7 +558,7 @@ items: uid: log-mon/metrics/built-in-diagnostics - name: Blazor (Components) metrics uid: log-mon/metrics/built-in-components - - name: Authentication, authorization, and Identity metrics + - name: Authentication and authorization metrics uid: log-mon/metrics/built-in-security - name: HttpContext uid: fundamentals/use-httpcontext From 394e2d712e0dc1a56f771865528e96fc2423c123 Mon Sep 17 00:00:00 2001 From: Wade Pickett Date: Tue, 4 Aug 2026 21:30:00 -0700 Subject: [PATCH 15/16] Apply suggestions from code review Co-authored-by: Wade Pickett --- aspnetcore/log-mon/metrics/built-in-http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index abcb2daedf45..05c0b90e847e 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -339,7 +339,7 @@ Value | Description Value | Description --- | --- -`server_sent_events` | [server-sent events](https://developer.mozilla.org/docs/Web/API/Server-sent_events/Using_server-sent_events) +`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) From 20cf2f928f8208dad24c040a16b8c0198e9172e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Aug 2026 05:20:55 +0000 Subject: [PATCH 16/16] Address outstanding metrics review feedback Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in-http.md | 2 +- aspnetcore/log-mon/metrics/built-in-security.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in-http.md b/aspnetcore/log-mon/metrics/built-in-http.md index 05c0b90e847e..d3921eeca553 100644 --- a/aspnetcore/log-mon/metrics/built-in-http.md +++ b/aspnetcore/log-mon/metrics/built-in-http.md @@ -76,7 +76,7 @@ Name | Instrument Type | Unit (UCUM) | Description 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.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. ## `Microsoft.AspNetCore.RateLimiting` diff --git a/aspnetcore/log-mon/metrics/built-in-security.md b/aspnetcore/log-mon/metrics/built-in-security.md index 3acef2e4cd5a..fd681664e231 100644 --- a/aspnetcore/log-mon/metrics/built-in-security.md +++ b/aspnetcore/log-mon/metrics/built-in-security.md @@ -30,7 +30,7 @@ Name | Instrument Type | Unit (UCUM) | Description Attribute | Type | Description | Examples | Presence --- | --- | --- | --- | --- `user.is_authenticated` | boolean | Whether the request came from an authenticated user. | `true` | `Required` -`aspnetcore.authorization.policy` | string | The name of the authorization policy. | `AtLeast21`; `EmployeeOnly` | `Conditionally required` if an authorization policy is used. +`aspnetcore.authorization.policy` | string | The name of the authorization policy. | `AtLeast21`; `EmployeeOnly` | `Conditionally Required` if an authorization policy is used. `aspnetcore.authorization.result` | string | Whether the authorization succeeded or failed. | `success`; `failure` | `Conditionally Required` if an exception is not thrown during authorization. `error.type` | string | The full name of the exception type. | `System.InvalidOperationException`; `Contoso.MyException` | `Conditionally Required` if the request has ended with an error.