Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions aspnetcore/log-mon/metrics/metrics.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: ASP.NET Core metrics
description: Metrics for ASP.NET Core apps
ai-usage: ai-assisted
author: tdykstra
ms.author: tdykstra
description: Metrics for ASP.NET Core apps
monikerRange: '>= aspnetcore-8.0'
ms.date: 10/18/2023
ms.author: tdykstra
ms.date: 11/10/2025
ms.topic: article
uid: log-mon/metrics/metrics
---
Expand Down Expand Up @@ -262,6 +263,51 @@ The proceeding test:
* Makes an HTTP request to the web app.
* Asserts the test using results from the metrics collector.

:::moniker range=">= aspnetcore-10.0"

## ASP.NET Core Identity metrics

ASP.NET Core Identity observability has been improved in .NET 10 with metrics. These metrics help you monitor user management activities and authentication processes.

The metrics are in the `Microsoft.AspNetCore.Identity` meter and include:

### User management metrics

* `aspnetcore.identity.user.create.duration` - Measures the duration of user creation operations
* `aspnetcore.identity.user.update.duration` - Measures the duration of user update operations
* `aspnetcore.identity.user.delete.duration` - Measures the duration of user deletion operations
* `aspnetcore.identity.user.check_password_attempts` - Counts password verification attempts
* `aspnetcore.identity.user.generated_tokens` - Counts tokens generated for users (like password reset tokens)
* `aspnetcore.identity.user.verify_token_attempts` - Counts token verification attempts

### Authentication metrics

* `aspnetcore.identity.sign_in.authenticate.duration` - Measures the duration of authentication operations
* `aspnetcore.identity.sign_in.check_password_attempts` - Counts password check attempts during sign-in
* `aspnetcore.identity.sign_in.sign_ins` - Counts successful sign-ins
* `aspnetcore.identity.sign_in.sign_outs` - Counts sign-outs
* `aspnetcore.identity.sign_in.two_factor_clients_remembered` - Counts remembered two-factor clients
* `aspnetcore.identity.sign_in.two_factor_clients_forgotten` - Counts forgotten two-factor clients

These metrics can be used to:

* Monitor user registration and management
Copy link
Collaborator

@guardrex guardrex Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these list items need periods. I make the suggestion below 👇.

* Track authentication patterns and potential security issues
* Measure performance of Identity operations
* Observe two-factor authentication usage

### Viewing Identity metrics

You can view these metrics using `dotnet-counters` to monitor them in real-time, or export them to Prometheus and visualize them in Grafana using the techniques described earlier in this article.

For example, to monitor all Identity metrics with `dotnet-counters`:

```dotnetcli
dotnet-counters monitor -n YourAppName --counters Microsoft.AspNetCore.Identity
```

:::moniker-end

## ASP.NET Core meters and counters

See [ASP.NET Core metrics](/dotnet/core/diagnostics/built-in-metrics-aspnetcore) for a list of ASP.NET Core meters and counters.
15 changes: 14 additions & 1 deletion aspnetcore/security/authentication/identity.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: Introduction to Identity on ASP.NET Core
ai-usage: ai-assisted
author: wadepickett
description: Use Identity with an ASP.NET Core app. Learn how to set password requirements (RequireDigit, RequiredLength, RequiredUniqueChars, and more).
monikerRange: '>= aspnetcore-3.0'
ms.author: wpickett
ms.date: 10/30/2025
ms.date: 11/10/2025
uid: security/authentication/identity
---
# Introduction to Identity on ASP.NET Core
Expand Down Expand Up @@ -202,6 +203,18 @@ The template-generated app doesn't use [authorization](xref:security/authorizati

For more information on `IdentityOptions`, see <xref:Microsoft.AspNetCore.Identity.IdentityOptions> and [Application Startup](xref:fundamentals/startup).

:::moniker-end
:::moniker range=">= aspnetcore-10.0"

## ASP.NET Core Identity metrics

ASP.NET Core Identity metrics provide monitoring capabilities for user management and authentication processes. These metrics help you detect unusual sign-in patterns that might indicate security threats, track the performance of identity operations, and understand how users interact with authentication features such as two-factor authentication. This observability is particularly valuable for applications with strict security requirements or those experiencing high authentication traffic. The ASP.NET Core Identity metrics were introduced in .NET 10.

For complete details on available metrics and how to use them, see <xref:log-mon/metrics/metrics#aspnet-core-identity-metrics>.

:::moniker-end
:::moniker range=">= aspnetcore-8.0"

<!-- Start here for .NET 6 -->

## Scaffold Register, Login, LogOut, and RegisterConfirmation
Expand Down