-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
Contributes to #35994
See details here:
#35994 (comment)
This information should primarily go into the aspnetcore/log-mon/metrics/metrics.mdfile, with a reference added to the aspnetcore/security/authentication/identity.md file.
This new information needs to be in moniker range for >=10.0 so it does not show up in previous versions of the content.
Reasoning:
The metrics.md file is specifically focused on ASP.NET Core metrics and already contains sections about built-in metrics and how to use them. The identity.md file is focused on introducing Identity functionality, not its implementation details like metrics.
Steps:
For aspnetcore/log-mon/metrics/metrics.md:
The ASP.NET Core Identity metrics information should be added at the end of the document, before the closing code fence. This is the more detailed version, as metrics.md is the primary place for metrics documentation:
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 operationsaspnetcore.identity.user.update.duration- Measures the duration of user update operationsaspnetcore.identity.user.delete.duration- Measures the duration of user deletion operationsaspnetcore.identity.user.check_password_attempts- Counts password verification attemptsaspnetcore.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 operationsaspnetcore.identity.sign_in.check_password_attempts- Counts password check attempts during sign-inaspnetcore.identity.sign_in.sign_ins- Counts successful sign-insaspnetcore.identity.sign_in.sign_outs- Counts sign-outsaspnetcore.identity.sign_in.two_factor_clients_remembered- Counts remembered two-factor clientsaspnetcore.identity.sign_in.two_factor_clients_forgotten- Counts forgotten two-factor clients
These metrics can be used to:
- Monitor user registration and management
- Track authentication patterns and potential security issues
- Measure performance of Identity operations
- Observe two-factor authentication usage
You can view these metrics using the techniques described earlier in this article, such as dotnet-counters or Prometheus with Grafana.
dotnet-counters monitor -n YourAppName --counters Microsoft.AspNetCore.Identity
For aspnetcore/security/authentication/identity.md
Insert a brief mention after the "Configure Identity services" section, where it talks about services and infrastructure:
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#asp.net-core-identity-metrics.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/log-mon/metrics/metrics?view=aspnetcore-10.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/log-mon/metrics/metrics.md
Document ID
fc4aa26a-a037-2bd9-f313-e3073d6b8232
Platform Id
b249ca56-4df1-23dc-97f7-ce3d64597006
Article author
Metadata
- ID: fc4aa26a-a037-2bd9-f313-e3073d6b8232
- PlatformId: b249ca56-4df1-23dc-97f7-ce3d64597006
- Service: aspnet-core