|
| 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> |
0 commit comments