-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Add Identity metrics documentation for .NET 10 #36324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+66
−5
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6d90cbe
Initial plan
Copilot 6ce720a
Add Identity metrics documentation for .NET 10
Copilot a6b15a8
Update ASP.NET Core Identity documentation
wadepickett 1abecf1
Apply suggestion from @wadepickett
wadepickett 762fb1e
Apply suggestions from code review
wadepickett 82d54e2
Apply suggestion from @wadepickett
wadepickett fba42c0
Fix punctuation and formatting in metrics.md
wadepickett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| --- | ||
|
|
@@ -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: | ||
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### User management metrics | ||
|
|
||
| * `aspnetcore.identity.user.create.duration` - Measures the duration of user creation operations | ||
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * `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) | ||
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * `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 | ||
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### 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. | ||
wadepickett marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.