From 6971213955cb3bc6be3ef22f341482aef532b1a3 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:21:16 -1000 Subject: [PATCH 01/13] .NET 10 metrics /1 --- .../metrics/built-in/includes/built-in10.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 367dc420ff10..ebfd8873367f 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -400,4 +400,98 @@ As this metric is tracking the connection duration, and ideally SignalR connecti | `signalr.transport` | string | [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) | `web_sockets`; `long_polling` | Always | . + +## `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 | Match result | `success`; `failure` | Always | +| `aspnetcore.authorization.policy` | string | The authorization policy. | `Basic` | Always | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | Always | + +. + +## `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`](#aspnetcore-authentication-authenticate-duration) +* [`aspnetcore.authentication.challenges`](#aspnetcore-authentication-challenges) +* [`aspnetcore.authentication.forbids`](#aspnetcore-authentication-forbids) +* [`aspnetcore.authentication.sign_ins`](#aspnetcore-authentication-sign-ins) + + +##### 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` | Always | +| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occured. | + +. + +##### 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 authentication scheme. | `custom` | Always | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occured. | + +. + +##### 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 are not permitted to access. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | +| `error.type` | string | The error message. | `An error occurred during sign out.` | If an authentication error or exception occured. | + +. + +##### 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. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | +| `error.type` | string | The error message. | `An error occurred during sign in` | If an authentication error or exception occured. | + +. + +##### Metric: `aspnetcore.authentication.sign_outs` + +| Name | Instrument Type | Unit (UCUM) | Description | +| -------- | --------------- | ----------- | -------------- | +| `aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a scheme is challenged. | + +| Attribute | Type | Description | Examples | Presence | +|---|---|---|---|---| +| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | +| `error.type` | string | The error message. | `An error occurred during sign out` | If an authentication error or exception occured. | + :::moniker-end From 8d2e2cc84b99f193cefea43800e32d89c36c394a Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:38:48 -1000 Subject: [PATCH 02/13] .NET 10 metrics /1 --- .../log-mon/metrics/built-in/includes/built-in10.md | 8 ++++---- aspnetcore/log-mon/metrics/metrics.md | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index ebfd8873367f..7be7a430aebd 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -424,10 +424,10 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho The `Microsoft.AspNetCore.Authentication` metrics report information about [Authentication](xref:security/authentication/index) in ASP.NET Core apps: -* [`aspnetcore.authentication.authenticate.duration`](#aspnetcore-authentication-authenticate-duration) -* [`aspnetcore.authentication.challenges`](#aspnetcore-authentication-challenges) -* [`aspnetcore.authentication.forbids`](#aspnetcore-authentication-forbids) -* [`aspnetcore.authentication.sign_ins`](#aspnetcore-authentication-sign-ins) +* [`aspnetcore.authentication.authenticate.duration`](#metric-aspnetcoreauthenticationauthenticateduration) +* [`aspnetcore.authentication.challenges`](#metric-aspnetcoreauthenticationchallenges) +* [`aspnetcore.authentication.forbids`](#metric-aspnetcoreauthenticationforbids) +* [`aspnetcore.authentication.sign_ins`](#metric-aspnetcoreauthenticationsignins) ##### Metric: `aspnetcore.authentication.authenticate.duration` diff --git a/aspnetcore/log-mon/metrics/metrics.md b/aspnetcore/log-mon/metrics/metrics.md index f438b55439a1..5bef09baac48 100644 --- a/aspnetcore/log-mon/metrics/metrics.md +++ b/aspnetcore/log-mon/metrics/metrics.md @@ -19,17 +19,19 @@ Metrics are numerical measurements reported over time. They're typically used to These metrics can be reported to a monitoring system at regular intervals. Dashboards can be setup to view metrics and alerts created to notify people of problems. If the web service is intended to respond to requests within 400 ms and starts responding in 600 ms, the monitoring system can notify the operations staff that the app response is slower than normal. -> [!TIP] -> See [ASP.NET Core metrics](/dotnet/core/diagnostics/built-in-metrics-aspnetcore) for a comprehensive list of all instruments together with their attributes. +See [ASP.NET Core metrics](xref:log-mon/metrics/built-in) for a comprehensive list of all instruments together with their attributes. -## Using metrics +## Use metrics -There are two parts to using metrics in a .NET app: +Using metrics involves the following: * **Instrumentation:** Code in .NET libraries takes measurements and associates these measurements with a metric name. .NET and ASP.NET Core include many built-in metrics. * **Collection:** A .NET app configures named metrics to be transmitted from the app for external storage and analysis. Some tools may perform configuration outside the app using configuration files or a UI tool. +* **Display:** A tool that can display the metrics in a human-readable format. This is often a web-based dashboard that can be customized to show the most important metrics for a specific app. +* **Alerting:** A tool that provides notifications when a metric exceeds a threshold. For example, if the average response time for a web service exceeds 400 ms, an alert can be sent to the operations staff. +* **Analysis:** A tool that can analyze the metrics over time. This is often a web-based dashboard that can be customized to show the most important metrics for a specific app. -Instrumented code can record numeric measurements, but the measurements need to be aggregated, transmitted, and stored to create useful metrics for monitoring. The process of aggregating, transmitting, and storing data is called collection. This tutorial shows several examples of collecting metrics: +Instrumented code can record numeric measurements, but the measurements need to be aggregated, transmitted, and stored to create useful metrics for monitoring. The process of aggregating, transmitting, and storing data is called collection. This tutorial shows several examples of collecting and displaying metrics: * Populating metrics in [Grafana](https://grafana.com/) with [OpenTelemetry](https://opentelemetry.io/) and [Prometheus](https://prometheus.io/). * Viewing metrics in real time with [`dotnet-counters`](/dotnet/core/diagnostics/dotnet-counters) From f76a1d810c9f3f9da3b298130d35bd236c26e75a Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:44:18 -1000 Subject: [PATCH 03/13] .NET 10 metrics /1 --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 7be7a430aebd..f65a35f9f9b5 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -1,7 +1,7 @@ :::moniker range=">= aspnetcore-10.0" This article describes the metrics built-in for ASP.NET Core produced using the - API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API,see [Available counters](/dotnet/core/diagnostics/available-counters). + API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters). See [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics) for information about how to collect, report, enrich, and test ASP.NET Core metrics @@ -78,8 +78,6 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT 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 | @@ -427,7 +425,8 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth * [`aspnetcore.authentication.authenticate.duration`](#metric-aspnetcoreauthenticationauthenticateduration) * [`aspnetcore.authentication.challenges`](#metric-aspnetcoreauthenticationchallenges) * [`aspnetcore.authentication.forbids`](#metric-aspnetcoreauthenticationforbids) -* [`aspnetcore.authentication.sign_ins`](#metric-aspnetcoreauthenticationsignins) +* [`aspnetcore.authentication.sign_ins`](#metric-aspnetcoreauthenticationsign_ins) +* [`aspnetcore.authentication.sign_outs`](#metric-aspnetcoreauthenticationsign_outs) ##### Metric: `aspnetcore.authentication.authenticate.duration` From a971217dfb8ea1347776e52bdf7c023a53e618f0 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 2 Apr 2025 16:50:14 -1000 Subject: [PATCH 04/13] .NET 10 metrics /1 --- .../metrics/built-in/includes/built-in10.md | 25 +++++++++---------- aspnetcore/log-mon/metrics/metrics.md | 4 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index f65a35f9f9b5..7651989503c7 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -403,8 +403,7 @@ As this metric is tracking the connection duration, and ideally SignalR connecti The `Microsoft.AspNetCore.Authorization` metrics report information about [Authorization attempts](xref:security/authorization/introduction) in ASP.NET Core apps: - -##### Metric: `aspnetcore.authorization.attempts` +#### Metric: `aspnetcore.authorization.attempts` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -413,6 +412,7 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `user.is_authenticated` | Boolean | Match result | `success`; `failure` | Always | +| `aspnetcore.authorization.result` | string | The authentication result. | `success` | Always | | `aspnetcore.authorization.policy` | string | The authorization policy. | `Basic` | Always | | `error.type` | string | The error message. | `An error occurred in the authorization handler` | Always | @@ -422,14 +422,13 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho 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) +- [`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` +#### Metric: `aspnetcore.authentication.authenticate.duration` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -443,7 +442,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth . -##### Metric: `aspnetcore.authentication.challenges` +#### Metric: `aspnetcore.authentication.challenges` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -456,7 +455,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth . -##### Metric: `aspnetcore.authentication.forbids` +#### Metric: `aspnetcore.authentication.forbids` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -469,7 +468,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth . -##### Metric: `aspnetcore.authentication.sign_ins` +#### Metric: `aspnetcore.authentication.sign_ins` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | @@ -482,7 +481,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth . -##### Metric: `aspnetcore.authentication.sign_outs` +#### Metric: `aspnetcore.authentication.sign_outs` | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | diff --git a/aspnetcore/log-mon/metrics/metrics.md b/aspnetcore/log-mon/metrics/metrics.md index 5bef09baac48..98a7759e5a10 100644 --- a/aspnetcore/log-mon/metrics/metrics.md +++ b/aspnetcore/log-mon/metrics/metrics.md @@ -26,8 +26,8 @@ See [ASP.NET Core metrics](xref:log-mon/metrics/built-in) for a comprehensive li Using metrics involves the following: * **Instrumentation:** Code in .NET libraries takes measurements and associates these measurements with a metric name. .NET and ASP.NET Core include many built-in metrics. -* **Collection:** A .NET app configures named metrics to be transmitted from the app for external storage and analysis. Some tools may perform configuration outside the app using configuration files or a UI tool. -* **Display:** A tool that can display the metrics in a human-readable format. This is often a web-based dashboard that can be customized to show the most important metrics for a specific app. +* **Collection and storage:** A .NET app configures named metrics to be transmitted from the app for external storage and analysis. Some tools may perform configuration outside the app using configuration files or a UI tool. +* **Visualization:** A tool that can display the metrics in a human-readable format. For example, [Grafana](https://grafana.com/) and [Prometheus](https://prometheus.io/). * **Alerting:** A tool that provides notifications when a metric exceeds a threshold. For example, if the average response time for a web service exceeds 400 ms, an alert can be sent to the operations staff. * **Analysis:** A tool that can analyze the metrics over time. This is often a web-based dashboard that can be customized to show the most important metrics for a specific app. From 96d29d5e54ddc2ea0fbc6ad33ae4b43c8f89e189 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:11:23 -1000 Subject: [PATCH 05/13] .NET 10 metrics /1 --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 7651989503c7..309c0f5a9d94 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -412,7 +412,7 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `user.is_authenticated` | Boolean | Match result | `success`; `failure` | Always | -| `aspnetcore.authorization.result` | string | The authentication result. | `success` | Always | +| `aspnetcore.authorization.result` | string | The authentication result. | `success` ; `failure` | Always | | `aspnetcore.authorization.policy` | string | The authorization policy. | `Basic` | Always | | `error.type` | string | The error message. | `An error occurred in the authorization handler` | Always | @@ -436,7 +436,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.authentication.result` | string | The authentication result. | `success` | Always | +| `aspnetcore.authentication.result` | string | The authentication result. | `success` ; `failure` | Always | | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | | `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occured. | From ffae500e9a76e0255308e47104f3293aa1ee83f7 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:36:20 -1000 Subject: [PATCH 06/13] .NET 10 metrics /1 --- .../log-mon/metrics/built-in/includes/built-in10.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 309c0f5a9d94..a6f2b112ea7e 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -438,7 +438,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth |---|---|---|---|---| | `aspnetcore.authentication.result` | string | The authentication result. | `success` ; `failure` | Always | | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occured. | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occurred. | . @@ -451,7 +451,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occured. | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occurred. | . @@ -459,12 +459,12 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | 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 are not permitted to access. | +| `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 authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out.` | If an authentication error or exception occured. | +| `error.type` | string | The error message. | `An error occurred during sign out.` | If an authentication error or exception occurred. | . @@ -477,7 +477,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign in` | If an authentication error or exception occured. | +| `error.type` | string | The error message. | `An error occurred during sign in` | If an authentication error or exception occurred. | . @@ -490,6 +490,6 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out` | If an authentication error or exception occured. | +| `error.type` | string | The error message. | `An error occurred during sign out` | If an authentication error or exception occurred. | :::moniker-end From 9540879849288e658f1bf3b852ff6da5a242a7bb Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:49:31 -1000 Subject: [PATCH 07/13] Update aspnetcore/log-mon/metrics/built-in/includes/built-in10.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index a6f2b112ea7e..127daafd5406 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -485,8 +485,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a scheme is challenged. | - +| `aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a principal is signed out. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | From 10b7e048afc531104ebde19761688e79689c24f2 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:46:13 -1000 Subject: [PATCH 08/13] .NET 10 metrics /1 --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 127daafd5406..812035258f2a 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -485,7 +485,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `aspnetcore.authentication.sign_outs` | Counter | `{request}` | The total number of times a principal is signed out. | +| `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 authentication scheme. | `custom` | Always | From 9fb46f61a1ad82fbc231a72b99944295e77f75fb Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:50:52 -1000 Subject: [PATCH 09/13] .NET 10 metrics /1 --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 1 - 1 file changed, 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 0264d43f65ac..c38aa6ca4ff6 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -78,7 +78,6 @@ The `Microsoft.AspNetCore.Routing` metrics report information about [routing HTT 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` From 0b76d2c18d89d13b1de5f11390a409fa26c7d60e Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:54:05 -1000 Subject: [PATCH 10/13] .NET 10 metrics /1 --- aspnetcore/log-mon/metrics/built-in/includes/built-in10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index c38aa6ca4ff6..fbfb27896a9f 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -474,7 +474,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Name | Instrument Type | Unit (UCUM) | Description | | -------- | --------------- | ----------- | -------------- | -| `aspnetcore.authentication.sign_ins` | Counter | `{request}` | The total number of times a principal is signed in. | +| `aspnetcore.authentication.sign_ins` | Counter | `{request}` | The total number of times a principal is signed in with a scheme. | | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| From 6d490146b842ad359000eecc8a5a384ee922ef7b Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:20:16 -1000 Subject: [PATCH 11/13] .NET 10 metrics /1 --- .../metrics/built-in/includes/built-in10.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index fbfb27896a9f..681b3f847a90 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -413,10 +413,10 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `user.is_authenticated` | Boolean | Match result | `success`; `failure` | Always | +| `user.is_authenticated` | Boolean | Whether the request came from an authenticated user. | `true`; `false` | Always | | `aspnetcore.authorization.result` | string | The authentication result. | `success` ; `failure` | Always | | `aspnetcore.authorization.policy` | string | The authorization policy. | `Basic` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | Always | +| `error.type` | string | The error message. | `An error occurred in the authorization handler` | Conditionally required if the request has ended with an error. | . @@ -438,9 +438,9 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.authentication.result` | string | The authentication result. | `success` ; `failure` | Always | -| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occurred. | +| `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 the request has ended with an error | . @@ -466,7 +466,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out.` | If an authentication error or exception occurred. | +| `error.type` | string | The error message. | `An error occurred during sign out.` | Conditionally required if the request has ended with an error. | . @@ -479,7 +479,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign in` | If an authentication error or exception occurred. | +| `error.type` | string | The error message. | `An error occurred during sign in` | Conditionally required if the request has ended with an error. | . @@ -491,6 +491,6 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| | `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out` | If an authentication error or exception occurred. | +| `error.type` | string | The error message. | `An error occurred during sign out` | Conditionally required if the request has ended with an error. | :::moniker-end From e44a1c9086badec4beabbc1e3af52fd5116fff2f Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 8 Apr 2025 13:54:47 -1000 Subject: [PATCH 12/13] .NET 10 metrics /1 --- .../metrics/built-in/includes/built-in10.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md index 681b3f847a90..872cec5c7663 100644 --- a/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md +++ b/aspnetcore/log-mon/metrics/built-in/includes/built-in10.md @@ -413,10 +413,10 @@ The `Microsoft.AspNetCore.Authorization` metrics report information about [Autho | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `user.is_authenticated` | Boolean | Whether the request came from an authenticated user. | `true`; `false` | Always | -| `aspnetcore.authorization.result` | string | The authentication result. | `success` ; `failure` | Always | -| `aspnetcore.authorization.policy` | string | The authorization policy. | `Basic` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | Conditionally required if the request has ended with an error. | +| `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 | . @@ -440,7 +440,7 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth |---|---|---|---|---| | `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 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 | . @@ -452,8 +452,8 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred in the authorization handler` | If an authentication error or exception occurred. | +| `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 | . @@ -465,8 +465,8 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out.` | Conditionally required if the request has ended 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 the request has ended with an error | . @@ -478,8 +478,8 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | Attribute | Type | Description | Examples | Presence | |---|---|---|---|---| -| `aspnetcore.authentication.scheme` | string | The authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign in` | Conditionally required if the request has ended 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 the request has ended with an error | . @@ -488,9 +488,10 @@ The `Microsoft.AspNetCore.Authentication` metrics report information about [Auth | 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 authentication scheme. | `custom` | Always | -| `error.type` | string | The error message. | `An error occurred during sign out` | Conditionally required if the request has ended 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 the request has ended with an error | :::moniker-end From 8aca32a93c93ab3798c673f6d5c75696a8adf0c6 Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Tue, 8 Apr 2025 14:02:59 -1000 Subject: [PATCH 13/13] .NET 10 metrics /1 --- 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 c9f4d9433ff0..506ea8df0c43 100644 --- a/aspnetcore/log-mon/metrics/built-in.md +++ b/aspnetcore/log-mon/metrics/built-in.md @@ -3,7 +3,7 @@ title: ASP.NET Core built-in metrics description: Built-in metrics for ASP.NET Core apps author: rick-anderson ms.author: riande -ms.date: 10/18/2023 +ms.date: 4/8/2025 ms.topic: reference uid: log-mon/metrics/built-in ---