Skip to content

Commit 21ab9d9

Browse files
CopilotwadepickettCopilot
authored
Split ASP.NET Core built-in metrics reference into topic-focused pages (#37421)
* Initial plan * Split built-in metrics page into focused topic pages Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> * Apply suggestion from @wadepickett * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Document aspnetcore.authorization.attempts metric Add information about authorization attempts metric in ASP.NET Core. * Apply suggestion from @wadepickett * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Apply suggestion from @wadepickett * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Apply suggestions from code review Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Address outstanding metrics review feedback Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> Co-authored-by: Wade Pickett <wpickett@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 72d2c10 commit 21ab9d9

8 files changed

Lines changed: 690 additions & 560 deletions

File tree

aspnetcore/fundamentals/servers/kestrel/security-considerations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Beyond rejection-specific signals, Kestrel emits a set of built-in metrics under
674674
These metrics integrate with OpenTelemetry, `dotnet-counters`, Prometheus exporters, and Azure Monitor. For full setup guidance, see:
675675
676676
- [ASP.NET Core metrics overview](xref:log-mon/metrics/metrics)
677-
- [Kestrel built-in metrics reference](/aspnet/core/log-mon/metrics/built-in#microsoftaspnetcoreserverkestrel)
677+
- [Kestrel built-in metrics reference](xref:log-mon/metrics/built-in-http#microsoftaspnetcoreserverkestrel)
678678
679679
### TLS-over-HTTP detection
680680
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: ASP.NET Core built-in Blazor (Components) metrics
3+
ai-usage: ai-assisted
4+
author: guardrex
5+
description: Learn about built-in Blazor (Components) metrics for ASP.NET Core apps, including component, lifecycle, and server circuit metrics.
6+
monikerRange: '>= aspnetcore-10.0'
7+
ms.author: wpickett
8+
ms.date: 08/05/2026
9+
ms.topic: reference
10+
uid: log-mon/metrics/built-in-components
11+
---
12+
# ASP.NET Core built-in Blazor (Components) metrics
13+
14+
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.
15+
16+
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>.
17+
18+
## `Microsoft.AspNetCore.Components`
19+
20+
The `Microsoft.AspNetCore.Components` metrics report information on Razor component route changes and browser events:
21+
22+
* [`aspnetcore.components.navigation`](#metric-aspnetcorecomponentsnavigation)
23+
* [`aspnetcore.components.event_handler`](#metric-aspnetcorecomponentsevent_handler)
24+
25+
### Metric: `aspnetcore.components.navigation`
26+
27+
Name | Instrument Type | Unit (UCUM) | Description
28+
--- | --- | --- | ---
29+
`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.
30+
31+
Attribute | Type | Description | Examples | Presence
32+
--- | --- | --- | --- | ---
33+
`aspnetcore.components.type` | string | Component navigated to. | `TestComponent` | Always
34+
`aspnetcore.components.route` | string | The component's route. | `/test-route` | Always
35+
`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown.
36+
37+
Usage: How many different Blazor pages did users visit?
38+
39+
### Metric: `aspnetcore.components.event_handler`
40+
41+
Name | Instrument Type | Unit (UCUM) | Description
42+
--- | --- | --- | ---
43+
`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.
44+
45+
Attribute | Type | Description | Examples | Presence
46+
--- | --- | --- | --- | ---
47+
`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always
48+
`aspnetcore.components.method` | string | C# method handling the event. | `OnClick` | Always
49+
`aspnetcore.components.attribute.name` | string | Component attribute name handling the event. | `onclick` | Always
50+
`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown.
51+
52+
Usage:
53+
54+
* Which component's click event handler is slow?
55+
* Which buttons are selected often?
56+
57+
## `Microsoft.AspNetCore.Components.Lifecycle`
58+
59+
The `Microsoft.AspNetCore.Components.Lifecycle` metrics report information on Razor component lifecycle events:
60+
61+
* [`aspnetcore.components.update_parameters`](#metric-aspnetcorecomponentsupdate_parameters)
62+
* [`aspnetcore.components.render_diff`](#metric-aspnetcorecomponentsrender_diff)
63+
64+
### Metric: `aspnetcore.components.update_parameters`
65+
66+
Name | Instrument Type | Unit (UCUM) | Description
67+
--- | --- | --- | ---
68+
`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.
69+
70+
Attribute | Type | Description | Examples | Presence
71+
--- | --- | --- | --- | ---
72+
`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always
73+
`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown.
74+
75+
Usage:
76+
77+
* Which components are slow to update?
78+
* Which components are updated often?
79+
80+
### Metric: `aspnetcore.components.render_diff`
81+
82+
Name | Instrument Type | Unit (UCUM) | Description
83+
--- | --- | --- | ---
84+
`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.
85+
86+
Attribute | Type | Description | Examples | Presence
87+
--- | --- | --- | --- | ---
88+
`aspnetcore.components.diff.length` | int | The length of the render diff/size of the batch (bucketed). | 50 | Always
89+
`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown.
90+
91+
Usage:
92+
93+
* Is server rendering slow?
94+
* Do I render diffs that are too large? (network bandwidth, DOM update)
95+
96+
## `Microsoft.AspNetCore.Components.Server.Circuits`
97+
98+
The `Microsoft.AspNetCore.Components.Server.Circuits` metrics report information on server-side Blazor circuits in Blazor Server and Blazor Web Apps:
99+
100+
* [`aspnetcore.components.circuit.active`](#metric-aspnetcorecomponentscircuitactive)
101+
* [`aspnetcore.components.circuit.connected`](#metric-aspnetcorecomponentscircuitconnected)
102+
* [`aspnetcore.components.circuit.duration`](#metric-aspnetcorecomponentscircuitduration)
103+
104+
### Metric: `aspnetcore.components.circuit.active`
105+
106+
Name | Instrument Type | Unit (UCUM) | Description
107+
--- | --- | --- | ---
108+
`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.
109+
110+
Usage: How much memory does the session state hold?
111+
112+
### Metric: `aspnetcore.components.circuit.connected`
113+
114+
Name | Instrument Type | Unit (UCUM) | Description
115+
--- | --- | --- | ---
116+
`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.
117+
118+
Usage: How many SignalR connections are open?
119+
120+
### Metric: `aspnetcore.components.circuit.duration`
121+
122+
Name | Instrument Type | Unit (UCUM) | Description
123+
--- | --- | --- | ---
124+
`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.
125+
126+
Usage:
127+
128+
* How many sessions processed?
129+
* How long do users keep the session/tab open?
130+
131+
## See also
132+
133+
* <xref:log-mon/metrics/built-in>
134+
* <xref:log-mon/metrics/built-in-http>
135+
* <xref:log-mon/metrics/built-in-diagnostics>
136+
* <xref:log-mon/metrics/built-in-security>
137+
* <xref:log-mon/metrics/metrics>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: ASP.NET Core built-in diagnostics metrics
3+
ai-usage: ai-assisted
4+
author: guardrex
5+
description: Learn about built-in diagnostics metrics for ASP.NET Core apps, reported by the error handling middleware.
6+
ms.author: wpickett
7+
ms.date: 08/05/2026
8+
ms.topic: reference
9+
uid: log-mon/metrics/built-in-diagnostics
10+
---
11+
# ASP.NET Core built-in diagnostics metrics
12+
13+
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.
14+
15+
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>.
16+
17+
## `Microsoft.AspNetCore.Diagnostics`
18+
19+
The `Microsoft.AspNetCore.Diagnostics` metrics report diagnostics information from [ASP.NET Core error handling middleware](/aspnet/core/fundamentals/error-handling):
20+
21+
* [`aspnetcore.diagnostics.exceptions`](#metric-aspnetcorediagnosticsexceptions)
22+
23+
### Metric: `aspnetcore.diagnostics.exceptions`
24+
25+
Name | Instrument Type | Unit (UCUM) | Description
26+
--- | --- | --- | ---
27+
[`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.
28+
29+
Attribute | Type | Description | Examples | Presence
30+
--- | --- | --- | --- | ---
31+
`aspnetcore.diagnostics.exception.result` | string | ASP.NET Core exception middleware handling result. | `handled`; `unhandled` | Always
32+
`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.
33+
`exception.type` | string | The full name of exception type. | `System.OperationCanceledException`; `Contoso.MyException` | Always
34+
35+
## See also
36+
37+
* <xref:log-mon/metrics/built-in>
38+
* <xref:log-mon/metrics/built-in-http>
39+
* <xref:log-mon/metrics/built-in-components>
40+
* <xref:log-mon/metrics/built-in-security>
41+
* <xref:log-mon/metrics/metrics>

0 commit comments

Comments
 (0)