-
Notifications
You must be signed in to change notification settings - Fork 24.6k
Split ASP.NET Core built-in metrics reference into topic-focused pages #37421
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
Open
Copilot
wants to merge
16
commits into
main
Choose a base branch
from
copilot/split-aspnet-core-metrics-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b9122d9
Initial plan
Copilot 0d12779
Split built-in metrics page into focused topic pages
Copilot 2261cc9
Apply suggestion from @wadepickett
wadepickett afc092c
Apply suggestions from code review
wadepickett e259aa5
Potential fix for pull request finding
wadepickett 993219c
Potential fix for pull request finding
wadepickett b159b1a
Potential fix for pull request finding
wadepickett 80b89bf
Potential fix for pull request finding
wadepickett 30511e1
Document aspnetcore.authorization.attempts metric
wadepickett f8d7804
Apply suggestion from @wadepickett
wadepickett 45493ec
Apply suggestions from code review
wadepickett b3ed88c
Apply suggestions from code review
wadepickett 6b440ad
Apply suggestion from @wadepickett
wadepickett 9b00805
Apply suggestions from code review
wadepickett 394e2d7
Apply suggestions from code review
wadepickett 20cf2f9
Address outstanding metrics review feedback
Copilot 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
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 |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| --- | ||
| title: ASP.NET Core built-in Blazor (Components) metrics | ||
| ai-usage: ai-assisted | ||
| author: guardrex | ||
| description: Learn about built-in Blazor (Components) metrics for ASP.NET Core apps, including component, lifecycle, and server circuit metrics. | ||
| monikerRange: '>= aspnetcore-10.0' | ||
| ms.author: wpickett | ||
| ms.date: 08/05/2026 | ||
| ms.topic: reference | ||
| uid: log-mon/metrics/built-in-components | ||
| --- | ||
| # ASP.NET Core built-in Blazor (Components) metrics | ||
|
|
||
| This article describes the built-in Blazor (Components) metrics for ASP.NET Core produced using the <xref:System.Diagnostics.Metrics?displayProperty=nameWithType> API. These metrics cover Razor component route changes and browser events, component lifecycle events, and server-side Blazor circuits. They're available in ASP.NET Core 10.0 or later. | ||
|
|
||
| For an overview of all built-in metrics reference pages and how to read this reference, see <xref:log-mon/metrics/built-in>. For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see <xref:log-mon/metrics/metrics>. | ||
|
|
||
| ## `Microsoft.AspNetCore.Components` | ||
|
|
||
| The `Microsoft.AspNetCore.Components` metrics report information on Razor component route changes and browser events: | ||
|
|
||
| * [`aspnetcore.components.navigation`](#metric-aspnetcorecomponentsnavigation) | ||
| * [`aspnetcore.components.event_handler`](#metric-aspnetcorecomponentsevent_handler) | ||
|
|
||
| ### Metric: `aspnetcore.components.navigation` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.navigation`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentsnavigation)--> | Counter | `{route}` | Tracks the total number of route changes in the app. | ||
|
|
||
| Attribute | Type | Description | Examples | Presence | ||
| --- | --- | --- | --- | --- | ||
| `aspnetcore.components.type` | string | Component navigated to. | `TestComponent` | Always | ||
| `aspnetcore.components.route` | string | The component's route. | `/test-route` | Always | ||
| `error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. | ||
|
|
||
| Usage: How many different Blazor pages did users visit? | ||
|
|
||
| ### Metric: `aspnetcore.components.event_handler` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.event_handler`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentsevent_handler)--> | Histogram | `s` | Measures the duration of processing browser events, including business logic of the component, excluding the duration of child component event handling. | ||
|
|
||
| Attribute | Type | Description | Examples | Presence | ||
| --- | --- | --- | --- | --- | ||
| `aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always | ||
| `aspnetcore.components.method` | string | C# method handling the event. | `OnClick` | Always | ||
| `aspnetcore.components.attribute.name` | string | Component attribute name handling the event. | `onclick` | Always | ||
| `error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. | ||
|
|
||
| Usage: | ||
|
|
||
| * Which component's click event handler is slow? | ||
| * Which buttons are selected often? | ||
|
|
||
| ## `Microsoft.AspNetCore.Components.Lifecycle` | ||
|
|
||
| The `Microsoft.AspNetCore.Components.Lifecycle` metrics report information on Razor component lifecycle events: | ||
|
|
||
| * [`aspnetcore.components.update_parameters`](#metric-aspnetcorecomponentsupdate_parameters) | ||
| * [`aspnetcore.components.render_diff`](#metric-aspnetcorecomponentsrender_diff) | ||
|
|
||
| ### Metric: `aspnetcore.components.update_parameters` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.update_parameters`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentsupdate_parameters)--> | Histogram | `s` | Measures the duration of processing component parameters, including business logic. | ||
|
|
||
| Attribute | Type | Description | Examples | Presence | ||
| --- | --- | --- | --- | --- | ||
| `aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always | ||
| `error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. | ||
|
|
||
| Usage: | ||
|
|
||
| * Which components are slow to update? | ||
| * Which components are updated often? | ||
|
|
||
| ### Metric: `aspnetcore.components.render_diff` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.render_diff`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentsrender_diff)--> | Histogram | `s` | Tracks the duration of rendering batches. | ||
|
|
||
| Attribute | Type | Description | Examples | Presence | ||
| --- | --- | --- | --- | --- | ||
| `aspnetcore.components.diff.length` | int | The length of the render diff/size of the batch (bucketed). | 50 | Always | ||
| `error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. | ||
|
|
||
| Usage: | ||
|
|
||
| * Is server rendering slow? | ||
| * Do I render diffs that are too large? (network bandwidth, DOM update) | ||
|
|
||
| ## `Microsoft.AspNetCore.Components.Server.Circuits` | ||
|
|
||
| The `Microsoft.AspNetCore.Components.Server.Circuits` metrics report information on server-side Blazor circuits in Blazor Server and Blazor Web Apps: | ||
|
|
||
| * [`aspnetcore.components.circuit.active`](#metric-aspnetcorecomponentscircuitactive) | ||
| * [`aspnetcore.components.circuit.connected`](#metric-aspnetcorecomponentscircuitconnected) | ||
| * [`aspnetcore.components.circuit.duration`](#metric-aspnetcorecomponentscircuitduration) | ||
|
|
||
| ### Metric: `aspnetcore.components.circuit.active` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.circuit.active`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentscircuitactive)--> | UpDownCounter | `{circuit}` | Shows the number of active circuits currently in memory. | ||
|
|
||
| Usage: How much memory does the session state hold? | ||
|
|
||
| ### Metric: `aspnetcore.components.circuit.connected` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.circuit.connected`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentscircuitconnected)--> | UpDownCounter | `{circuit}` | Tracks the number of circuits connected to clients. | ||
|
|
||
| Usage: How many SignalR connections are open? | ||
|
|
||
| ### Metric: `aspnetcore.components.circuit.duration` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| `aspnetcore.components.circuit.duration`<!--](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/#metric-aspnetcorecomponentscircuitduration)--> | Histogram | `s` | Measures circuit lifetime duration and provides total circuit count. | ||
|
|
||
| Usage: | ||
|
|
||
| * How many sessions processed? | ||
| * How long do users keep the session/tab open? | ||
|
|
||
| ## See also | ||
|
|
||
| * <xref:log-mon/metrics/built-in> | ||
| * <xref:log-mon/metrics/built-in-http> | ||
| * <xref:log-mon/metrics/built-in-diagnostics> | ||
| * <xref:log-mon/metrics/built-in-security> | ||
| * <xref:log-mon/metrics/metrics> | ||
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 |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| title: ASP.NET Core built-in diagnostics metrics | ||
| ai-usage: ai-assisted | ||
| author: guardrex | ||
| description: Learn about built-in diagnostics metrics for ASP.NET Core apps, reported by the error handling middleware. | ||
| ms.author: wpickett | ||
| ms.date: 08/05/2026 | ||
| ms.topic: reference | ||
| uid: log-mon/metrics/built-in-diagnostics | ||
| --- | ||
| # ASP.NET Core built-in diagnostics metrics | ||
|
|
||
| This article describes the built-in diagnostics metrics for ASP.NET Core produced using the <xref:System.Diagnostics.Metrics?displayProperty=nameWithType> API. These metrics report diagnostics information from the ASP.NET Core error handling middleware. | ||
|
|
||
| For an overview of all built-in metrics reference pages and how to read this reference, see <xref:log-mon/metrics/built-in>. For information on how to collect, report, enrich, and test with ASP.NET Core metrics, see <xref:log-mon/metrics/metrics>. | ||
|
|
||
| ## `Microsoft.AspNetCore.Diagnostics` | ||
|
|
||
| The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling): | ||
|
|
||
| * [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions) | ||
|
|
||
| ### Metric: `aspnetcore.diagnostics.exceptions` | ||
|
|
||
| Name | Instrument Type | Unit (UCUM) | Description | ||
| --- | --- | --- | --- | ||
| [`aspnetcore.diagnostics.exceptions`](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/#metric-aspnetcorediagnosticsexceptions) | Counter | `{exception}` | Number of exceptions caught by exception handling middleware. | ||
|
|
||
| Attribute | Type | Description | Examples | Presence | ||
| --- | --- | --- | --- | --- | ||
| `aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result. | `handled`; `unhandled` | Always | ||
| `aspnetcore.diagnostics.handler.type` | string | Full type name of the [`IExceptionHandler`](/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. | `Contoso.MyHandler` | If the exception was handled by this handler. | ||
| `exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always | ||
|
|
||
| ## See also | ||
|
|
||
| * <xref:log-mon/metrics/built-in> | ||
| * <xref:log-mon/metrics/built-in-http> | ||
| * <xref:log-mon/metrics/built-in-components> | ||
| * <xref:log-mon/metrics/built-in-security> | ||
| * <xref:log-mon/metrics/metrics> |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have components after "including" do we need it in parentheses?