Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Fixes #36075

Adds documentation for the 12 new ASP.NET Core Identity metrics introduced in .NET 10 (Microsoft.AspNetCore.Identity meter).

Changes

  • aspnetcore/log-mon/metrics/metrics.md: Added comprehensive Identity metrics section with user management (6 metrics) and authentication (6 metrics) categories, usage guidance, and dotnet-counters example. Scoped to >= aspnetcore-10.0.

  • aspnetcore/security/authentication/identity.md: Added brief cross-reference section after "Configure Identity services" with xref link to detailed metrics documentation. Scoped to >= aspnetcore-10.0.

  • Metadata: Updated ms.date to 11/10/2025 and added ai-usage: ai-assisted to both files.

Metrics Documented

User management: user.create.duration, user.update.duration, user.delete.duration, user.check_password_attempts, user.generated_tokens, user.verify_token_attempts

Authentication: sign_in.authenticate.duration, sign_in.check_password_attempts, sign_in.sign_ins, sign_in.sign_outs, sign_in.two_factor_clients_remembered, sign_in.two_factor_clients_forgotten

Original prompt

This section details on the original issue you should resolve

<issue_title>.NET 10 RC1: Add Identity metrics to doc set</issue_title>
<issue_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 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</issue_description>

<agent_instructions>Also follow additonal analysis and instructions provided in the issue discussion.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@wadepickett

AI analysis test ru...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Internal previews

📄 File 🔗 Preview link
aspnetcore/log-mon/metrics/metrics.md ASP.NET Core metrics
aspnetcore/security/authentication/identity.md Introduction to Identity on ASP.NET Core

Copilot AI changed the title [WIP] Add Identity metrics to documentation set Add Identity metrics documentation for .NET 10 Nov 10, 2025
Copilot AI requested a review from wadepickett November 10, 2025 23:56
Copilot finished work on behalf of wadepickett November 10, 2025 23:56
Added to View Identity metric section
@wadepickett wadepickett marked this pull request as ready for review November 11, 2025 07:30
Copy link
Contributor

@wadepickett wadepickett left a comment

Choose a reason for hiding this comment

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

Approved with fixes I added.

@wadepickett wadepickett requested a review from tdykstra November 11, 2025 07:32
@wadepickett
Copy link
Contributor

@tdykstra or @guardrex, could use your review.

@wadepickett wadepickett requested a review from guardrex November 11, 2025 16:17
Copy link
Collaborator

@guardrex guardrex left a comment

Choose a reason for hiding this comment

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

Approving with recommendations.


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 👇.

Suggested udpated from guardrex

Co-authored-by: Luke Latham <[email protected]>
Corrected punctuation and formatting for consistency in metrics documentation.
@wadepickett wadepickett merged commit a7b09b2 into main Nov 11, 2025
4 checks passed
@wadepickett wadepickett deleted the copilot/add-identity-metrics-docs branch November 11, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 10 RC1: Add Identity metrics to doc set

3 participants