diff --git a/docs/dotnet/README.md b/docs/dotnet/README.md index 7e6c2f8f82..f3bc37f094 100644 --- a/docs/dotnet/README.md +++ b/docs/dotnet/README.md @@ -18,3 +18,4 @@ The following metrics are currently supported: * [Kestrel](dotnet-kestrel-metrics.md): Semantic Conventions for Kestrel web server *metrics*. * [SignalR](dotnet-signalr-metrics.md): Semantic Conventions for SignalR server *metrics*. * [Runtime](/docs/runtime/dotnet-metrics.md): Semantic conventions for .NET Runtime *metrics*. +* [Blazor](dotnet-blazor-metrics.md): Semantic Conventions for Blazor UI framework *metrics*. diff --git a/docs/dotnet/dotnet-blazor-metrics.md b/docs/dotnet/dotnet-blazor-metrics.md new file mode 100644 index 0000000000..fb4e6b6880 --- /dev/null +++ b/docs/dotnet/dotnet-blazor-metrics.md @@ -0,0 +1,8 @@ +# Semantic conventions for Blazor UI framework + +**Status**: [Development][DocumentStatus] + +This article defines semantic conventions for Blazor metrics emitted by .NET components. + + + diff --git a/model/aspnetcore/metrics.yaml b/model/aspnetcore/metrics.yaml index d24b7ffc54..e9bb241df9 100644 --- a/model/aspnetcore/metrics.yaml +++ b/model/aspnetcore/metrics.yaml @@ -135,3 +135,130 @@ groups: attributes: - ref: aspnetcore.rate_limiting.result requirement_level: required + + # blazor components + - id: metric.aspnetcore.components.navigate + type: metric + metric_name: aspnetcore.components.navigate + stability: development + brief: Total number of route changes. + instrument: counter + unit: "{route}" + note: > + Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + More about [Blazor routing](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing) + attributes: + - ref: aspnetcore.components.type + requirement_level: required + - ref: aspnetcore.components.route + requirement_level: required + + - id: metric.aspnetcore.components.handle_event.duration + type: metric + metric_name: aspnetcore.components.handle_event.duration + stability: development + brief: Duration of processing browser event handler. + instrument: histogram + unit: "s" + note: > + Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) + attributes: + - ref: aspnetcore.components.type + requirement_level: required + - ref: code.function.name + requirement_level: required + - ref: aspnetcore.components.attribute.name + requirement_level: required + - ref: error.type + brief: The full name of exception type. + examples: ['System.OperationCanceledException', 'Contoso.MyException'] + requirement_level: + conditionally_required: If handler has ended with an error. + + - id: metric.aspnetcore.components.update_parameters.duration + type: metric + metric_name: aspnetcore.components.update_parameters.duration + stability: development.duration + brief: Duration of processing component parameters. + instrument: histogram + unit: "s" + note: > + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + More about [Blazor parameters](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/cascading-values-and-parameters) + attributes: + - ref: aspnetcore.components.type + requirement_level: required + - ref: error.type + brief: The full name of exception type. + examples: ['System.OperationCanceledException', 'Contoso.MyException'] + requirement_level: + conditionally_required: If handler has ended with an error. + + - id: metric.aspnetcore.components.render_diff.duration + type: metric + metric_name: aspnetcore.components.render_diff.duration + stability: development + brief: Duration of rendering difference batch between previous and current HTML. + instrument: histogram + unit: "s" + note: > + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) + attributes: + - ref: error.type + brief: The full name of exception type. + examples: ['System.OperationCanceledException', 'Contoso.MyException'] + requirement_level: + conditionally_required: If handler has ended with an error. + + - id: metric.aspnetcore.components.render_diff.size + type: metric + metric_name: aspnetcore.components.render_diff.size + stability: development + brief: Size of rendering difference batch between previous and current HTML. + instrument: histogram + unit: "element" + note: > + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) + attributes: + - ref: error.type + brief: The full name of exception type. + examples: ['System.OperationCanceledException', 'Contoso.MyException'] + requirement_level: + conditionally_required: If handler has ended with an error. + + # Blazor circuits + - id: metric.aspnetcore.components.circuit.duration + type: metric + metric_name: aspnetcore.components.circuit.duration + stability: development + brief: Duration of circuit including time after re-connect. + instrument: histogram + unit: "s" + note: > + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) + + - id: metric.aspnetcore.components.circuit.active + type: metric + metric_name: aspnetcore.components.circuit.active + stability: development + brief: Number of circuits in memory, both connected and waiting for re-connect. + instrument: updowncounter + unit: "{circuit}" + note: > + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) + + - id: metric.aspnetcore.components.circuit.connected + type: metric + metric_name: aspnetcore.components.circuit.connected + stability: development + brief: Number of connected circuits. + instrument: updowncounter + unit: "{circuit}" + note: > + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index 71677d5980..ed6713e4a6 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -83,3 +83,33 @@ groups: stability: stable brief: ASP.NET Core exception middleware handling result examples: ["handled", "unhandled"] + - id: aspnetcore.components.type + type: string + stability: development + brief: Full type name of the Blazor component. + note: > + This is full name of the C# component class, including the namespace. + More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) + examples: ["Contoso.Weather"] + - id: aspnetcore.components.attribute.name + type: string + stability: development + brief: Attribute name of the event handler in Blazor component. + note: > + This is name of the binding attribute in the component markup. + More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) + examples: ["onclick"] + - id: aspnetcore.components.route + type: string + stability: development + brief: Segment of the URL that is matched to a Blazor @page component. + note: > + This route pattern is used to match the URL to the component. + More about [Blazor routing](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing) + examples: ["/weather", "/counter"] + - id: aspnetcore.components.circuit.id + type: string + stability: development + brief: Id of the Blazor circuit. + note: More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) + examples: ["ztOXUZxeJvS2b3ioeZ68bal8RQmQehui02CtZER"] diff --git a/model/aspnetcore/spans.yaml b/model/aspnetcore/spans.yaml new file mode 100644 index 0000000000..6e1c5af995 --- /dev/null +++ b/model/aspnetcore/spans.yaml @@ -0,0 +1,55 @@ +groups: + - id: span.Microsoft.AspNetCore.Components.Server.Circuits.StartCircuit + type: span + span_kind: internal + brief: + note: > + ActivitySource name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) + stability: development + attributes: + - ref: aspnetcore.components.circuit.id + requirement_level: required + - ref: error.type + requirement_level: + conditionally_required: if the circuit initialization failed + - id: span.Microsoft.AspNetCore.Components.Navigate + type: span + span_kind: internal + brief: + note: > + ActivitySource name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + More about [Blazor routing](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing) + stability: development + attributes: + - ref: aspnetcore.components.circuit.id + requirement_level: required + - ref: aspnetcore.components.type + requirement_level: required + - ref: aspnetcore.components.route + requirement_level: required + - ref: error.type + requirement_level: + conditionally_required: if the circuit initialization failed + - id: span.Microsoft.AspNetCore.Components.HandleEvent + type: span + span_kind: internal + brief: + note: > + ActivitySource name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) + stability: development + attributes: + - ref: aspnetcore.components.circuit.id + requirement_level: required + - ref: aspnetcore.components.type + requirement_level: required + - ref: aspnetcore.components.route + requirement_level: required + - ref: code.function.name + requirement_level: required + - ref: aspnetcore.components.attribute.name + requirement_level: required + - ref: error.type + requirement_level: + conditionally_required: if the circuit initialization failed