Skip to content

.NET 10 RC1: Add Identity metrics to doc setΒ #36075

@wadepickett

Description

@wadepickett

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 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
  • 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

@tdykstra

Metadata

  • ID: fc4aa26a-a037-2bd9-f313-e3073d6b8232
  • PlatformId: b249ca56-4df1-23dc-97f7-ce3d64597006
  • Service: aspnet-core

Related Issues


Associated WorkItem - 488324

Metadata

Metadata

Labels

10.0.NET 10Pri1Source - Docs.msDocs Customer feedback via GitHub Issueaspnet-core/svcseQUESTeredIdentifies that an issue has been imported into Quest.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions