|
3 | 3 | This article describes the metrics built-in for ASP.NET Core produced using the
|
4 | 4 | <xref:System.Diagnostics.Metrics?displayProperty=nameWithType> API. For a listing of metrics based on the older [EventCounters](/dotnet/core/diagnostics/event-counters) API, see [Available counters](/dotnet/core/diagnostics/available-counters).
|
5 | 5 |
|
6 |
| -See [Using ASP.NET Core metrics](xref:log-mon/metrics/metrics) for information about how to collect, report, enrich, and test ASP.NET Core metrics |
| 6 | +For information about how to collect, report, enrich, and test ASP.NET Core metrics, see <xref:log-mon/metrics/metrics>. |
| 7 | + |
| 8 | +## `Microsoft.AspNetCore.Components` |
| 9 | + |
| 10 | +The `Microsoft.AspNetCore.Components` metrics report information on Razor component route changes and browser events: |
| 11 | + |
| 12 | +* [`aspnetcore.components.navigation`](#metric-aspnetcorecomponentsnavigation) |
| 13 | +* [`aspnetcore.components.event_handler`](#metric-aspnetcorecomponentsevent_handler) |
| 14 | + |
| 15 | +#### Metric: `aspnetcore.components.navigation` |
| 16 | + |
| 17 | +Name | Instrument Type | Unit (UCUM) | Description |
| 18 | +--- | --- | --- | --- |
| 19 | +`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. |
| 20 | + |
| 21 | +Attribute | Type | Description | Examples | Presence |
| 22 | +--- | --- | --- | --- | --- |
| 23 | +`aspnetcore.components.type` | string | Component navigated to. | `TestComponent` | Always |
| 24 | +`aspnetcore.components.route` | string | The component's route. | `/test-route` | Always |
| 25 | + |
| 26 | +#### Metric: `aspnetcore.components.event_handler` |
| 27 | + |
| 28 | +Name | Instrument Type | Unit (UCUM) | Description |
| 29 | +--- | --- | --- | --- |
| 30 | +`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. |
| 31 | + |
| 32 | +Attribute | Type | Description | Examples | Presence |
| 33 | +--- | --- | --- | --- | --- |
| 34 | +`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always |
| 35 | +`aspnetcore.components.method` | string | C# method handling the event. | `OnClick` | Always |
| 36 | +`aspnetcore.components.attribute.name` | string | Component attribute name handling the event. | `onclick` | Always |
| 37 | +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. |
| 38 | + |
| 39 | +## `Microsoft.AspNetCore.Components.Lifecycle` |
| 40 | + |
| 41 | +The `Microsoft.AspNetCore.Components.Lifecycle` metrics report information on Razor component lifecycle events: |
| 42 | + |
| 43 | +* [`aspnetcore.components.update_parameters`](#metric-aspnetcorecomponentsupdate_parameters) |
| 44 | +* [`aspnetcore.components.render_diff`](#metric-aspnetcorecomponentsrender_diff) |
| 45 | + |
| 46 | +#### Metric: `aspnetcore.components.update_parameters` |
| 47 | + |
| 48 | +Name | Instrument Type | Unit (UCUM) | Description |
| 49 | +--- | --- | --- | --- |
| 50 | +`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. |
| 51 | + |
| 52 | +Attribute | Type | Description | Examples | Presence |
| 53 | +--- | --- | --- | --- | --- |
| 54 | +`aspnetcore.components.type` | string | Component type handling the event. | `TestComponent` | Always |
| 55 | +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. |
| 56 | + |
| 57 | +#### Metric: `aspnetcore.components.render_diff` |
| 58 | + |
| 59 | +Name | Instrument Type | Unit (UCUM) | Description |
| 60 | +--- | --- | --- | --- |
| 61 | +`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. |
| 62 | + |
| 63 | +Attribute | Type | Description | Examples | Presence |
| 64 | +--- | --- | --- | --- | --- |
| 65 | +`aspnetcore.components.diff.length` | int | The length of the render diff. | 50 | Always |
| 66 | +`error.type` | string | The full name of exception type. | `System.InvalidOperationException`; `Contoso.MyException` | If an exception is thrown. |
| 67 | + |
| 68 | +## `Microsoft.AspNetCore.Components.Server.Circuits` |
| 69 | + |
| 70 | +The `Microsoft.AspNetCore.Components.Server.Circuits` metrics report information on server-side Blazor circuits in Blazor Server and Blazor Web Apps: |
| 71 | + |
| 72 | +* [`aspnetcore.components.circuit.active`](#metric-aspnetcorecomponentscircuitactive) |
| 73 | +* [`aspnetcore.components.circuit.connected`](#metric-aspnetcorecomponentscircuitconnected) |
| 74 | +* [`aspnetcore.components.circuit.duration`](#metric-aspnetcorecomponentscircuitduration) |
| 75 | + |
| 76 | +#### Metric: `aspnetcore.components.circuit.active` |
| 77 | + |
| 78 | +Name | Instrument Type | Unit (UCUM) | Description |
| 79 | +--- | --- | --- | --- |
| 80 | +`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. |
| 81 | + |
| 82 | +#### Metric: `aspnetcore.components.circuit.connected` |
| 83 | + |
| 84 | +Name | Instrument Type | Unit (UCUM) | Description |
| 85 | +--- | --- | --- | --- |
| 86 | +`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. |
| 87 | + |
| 88 | +#### Metric: `aspnetcore.components.circuit.duration` |
| 89 | + |
| 90 | +Name | Instrument Type | Unit (UCUM) | Description |
| 91 | +--- | --- | --- | --- |
| 92 | +`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. |
7 | 93 |
|
8 | 94 | ## `Microsoft.AspNetCore.Hosting`
|
9 | 95 |
|
|
0 commit comments