From 278c73a9e084b415ac3de480ac977b7cdafa4398 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Tue, 6 May 2025 15:13:07 +0200 Subject: [PATCH 1/7] first attempt --- docs/dotnet/README.md | 1 + docs/dotnet/dotnet-blazor-metrics.md | 11 ++ model/aspnetcore/metrics.yaml | 174 +++++++++++++++++++++++++++ model/aspnetcore/registry.yaml | 25 ++++ 4 files changed, 211 insertions(+) create mode 100644 docs/dotnet/dotnet-blazor-metrics.md diff --git a/docs/dotnet/README.md b/docs/dotnet/README.md index b6731b5c35..d6cbfd28dd 100644 --- a/docs/dotnet/README.md +++ b/docs/dotnet/README.md @@ -15,5 +15,6 @@ The following metrics are currently supported: * [HTTP](dotnet-http-metrics.md): Semantic Conventions for HTTP client and server *metrics*. * [Kestrel](dotnet-kestrel-metrics.md): Semantic Conventions for Kestrel web server *metrics*. * [SignalR](dotnet-signalr-metrics.md): Semantic Conventions for SignalR server *metrics*. +* [Blazor](dotnet-blazor-metrics.md): Semantic Conventions for Blazor UI framework *metrics*. [DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status diff --git a/docs/dotnet/dotnet-blazor-metrics.md b/docs/dotnet/dotnet-blazor-metrics.md new file mode 100644 index 0000000000..0e7923cf37 --- /dev/null +++ b/docs/dotnet/dotnet-blazor-metrics.md @@ -0,0 +1,11 @@ + + +# Semantic conventions for Blazor UI framework + +**Status**: [Development][DocumentStatus] + +This article defines semantic conventions for Blazor metrics emitted by .NET components. + +TODO - is this generated ? \ No newline at end of file diff --git a/model/aspnetcore/metrics.yaml b/model/aspnetcore/metrics.yaml index 89951e26d7..845c72ca90 100644 --- a/model/aspnetcore/metrics.yaml +++ b/model/aspnetcore/metrics.yaml @@ -6,6 +6,17 @@ groups: - ref: aspnetcore.rate_limiting.policy requirement_level: conditionally_required: if the matched endpoint for the request had a rate-limiting policy. + - id: aspnetcore.components.metrics.attributes + type: attribute_group + brief: Blazor metrics attributes + + - id: aspnetcore.components.lifecycle.metrics.attributes + type: attribute_group + brief: Blazor metrics attributes + + - id: aspnetcore.components.circuits.metrics.attributes + type: attribute_group + brief: Blazor circuits metrics attributes # routing - id: metric.aspnetcore.routing.match_attempts @@ -114,3 +125,166 @@ groups: attributes: - ref: aspnetcore.rate_limiting.result requirement_level: required + + # blazor components + - id: metric.aspnetcore.components.navigation + type: metric + metric_name: aspnetcore.components.navigation + 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 + extends: aspnetcore.components.metrics.attributes + attributes: + - ref: aspnetcore.components.type + requirement_level: required + - ref: aspnetcore.components.route + requirement_level: required + + - id: metric.aspnetcore.components.event.duration + type: metric + metric_name: aspnetcore.components.event.duration + stability: development + brief: Duration of processing browser event. + instrument: histogram + unit: "s" + note: | + Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.metrics.attributes + attributes: + - ref: aspnetcore.components.type + requirement_level: required + - ref: aspnetcore.components.method + requirement_level: required + - ref: aspnetcore.components.attribute.name + requirement_level: required + + - id: metric.aspnetcore.components.event.exceptions + type: metric + metric_name: aspnetcore.components.event.exceptions + stability: development + brief: Total number of exceptions during browser event processing. + instrument: counter + unit: "{exception}" + note: | + Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.metrics.attributes + attributes: + - ref: aspnetcore.components.type + 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: required + + - id: metric.aspnetcore.components.update_parameters.duration + type: metric + metric_name: aspnetcore.components.update_parameters.duration + stability: development + brief: Duration of processing component parameters. + instrument: histogram + unit: "s" + note: | + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.lifecycle.metrics.attributes + attributes: + - ref: aspnetcore.components.type + requirement_level: required + + - id: metric.aspnetcore.components.update_parameters.exceptions + type: metric + metric_name: aspnetcore.components.update_parameters.exceptions + stability: development + brief: Total number of exceptions during processing component parameters. + instrument: counter + unit: "{exception}" + note: | + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.lifecycle.metrics.attributes + 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: required + + - id: metric.aspnetcore.components.rendering.batch.duration + type: metric + metric_name: aspnetcore.components.rendering.batch.duration + stability: development + brief: Duration of rendering batch. + instrument: histogram + unit: "s" + note: | + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.lifecycle.metrics.attributes + attributes: + - ref: aspnetcore.components.diff.approximate.length + requirement_level: required + + - id: metric.aspnetcore.components.rendering.batch.exceptions + type: metric + metric_name: aspnetcore.components.rendering.batch.exceptions + stability: development + brief: Total number of exceptions during batch rendering. + instrument: counter + unit: "{exception}" + note: | + Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.lifecycle.metrics.attributes + attributes: + - ref: error.type + brief: The full name of exception type. + examples: ['System.OperationCanceledException', 'Contoso.MyException'] + requirement_level: required + + # Blazor circuits + - id: metric.aspnetcore.components.circuits.count + type: metric + metric_name: aspnetcore.components.circuits.count + stability: development + brief: Total number of circuits. + instrument: counter + unit: "{circuit}" + note: | + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.circuits.metrics.attributes + + - id: metric.aspnetcore.components.circuits.active_circuits + type: metric + metric_name: aspnetcore.components.circuits.active_circuits + stability: development + brief: Number of active circuits. + instrument: updowncounter + unit: "{circuit}" + note: | + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.circuits.metrics.attributes + + - id: metric.aspnetcore.components.circuits.connected_circuits + type: metric + metric_name: aspnetcore.components.circuits.connected_circuits + 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 + extends: aspnetcore.components.circuits.metrics.attributes + + - id: metric.aspnetcore.components.circuits.duration + type: metric + metric_name: aspnetcore.components.circuits.duration + stability: development + brief: Duration of circuit. + instrument: histogram + unit: "s" + note: | + Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 + extends: aspnetcore.components.circuits.metrics.attributes + diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index 71677d5980..06a2ea8f2f 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -83,3 +83,28 @@ 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. + examples: ["Contoso.Weather"] + - id: aspnetcore.components.method + type: string + stability: development + brief: Method name of the event handler in Blazor component. + examples: ["IncrementCount"] + - id: aspnetcore.components.attribute.name + type: string + stability: development + brief: Attribute name of the event handler in Blazor component. + examples: ["onclick"] + - id: aspnetcore.components.route + type: string + stability: development + brief: Segment of the URL that is matched to a Blazor @page component. + examples: ["/weather", "/counter"] + - id: aspnetcore.components.diff.approximate.length + type: int + stability: development + brief: Bucketed length of the diff in Blazor rendering pipeline. + examples: [10, 100, 1000] From 92f860b0bad67e56fe0741b7292f2c4d8d081294 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Wed, 14 May 2025 19:46:33 +0200 Subject: [PATCH 2/7] sync with asp repo --- model/aspnetcore/metrics.yaml | 140 +++++++++------------------------ model/aspnetcore/registry.yaml | 7 +- model/aspnetcore/spans.yaml | 53 +++++++++++++ 3 files changed, 98 insertions(+), 102 deletions(-) create mode 100644 model/aspnetcore/spans.yaml diff --git a/model/aspnetcore/metrics.yaml b/model/aspnetcore/metrics.yaml index 845c72ca90..4b52c16c4a 100644 --- a/model/aspnetcore/metrics.yaml +++ b/model/aspnetcore/metrics.yaml @@ -6,17 +6,6 @@ groups: - ref: aspnetcore.rate_limiting.policy requirement_level: conditionally_required: if the matched endpoint for the request had a rate-limiting policy. - - id: aspnetcore.components.metrics.attributes - type: attribute_group - brief: Blazor metrics attributes - - - id: aspnetcore.components.lifecycle.metrics.attributes - type: attribute_group - brief: Blazor metrics attributes - - - id: aspnetcore.components.circuits.metrics.attributes - type: attribute_group - brief: Blazor circuits metrics attributes # routing - id: metric.aspnetcore.routing.match_attempts @@ -134,25 +123,25 @@ groups: brief: Total number of route changes. instrument: counter unit: "{route}" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.metrics.attributes + 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.event.duration + - id: metric.aspnetcore.components.event_handler type: metric - metric_name: aspnetcore.components.event.duration + metric_name: aspnetcore.components.event_handler stability: development - brief: Duration of processing browser event. + brief: Duration of processing browser event handler. instrument: histogram unit: "s" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.metrics.attributes + 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 @@ -160,131 +149,80 @@ groups: requirement_level: required - ref: aspnetcore.components.attribute.name requirement_level: required - - - id: metric.aspnetcore.components.event.exceptions - type: metric - metric_name: aspnetcore.components.event.exceptions - stability: development - brief: Total number of exceptions during browser event processing. - instrument: counter - unit: "{exception}" - note: | - Meter name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.metrics.attributes - attributes: - - ref: aspnetcore.components.type - 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: required + requirement_level: + conditionally_required: If handler has ended with an error. - - id: metric.aspnetcore.components.update_parameters.duration + - id: metric.aspnetcore.components.update_parameters type: metric - metric_name: aspnetcore.components.update_parameters.duration + metric_name: aspnetcore.components.update_parameters stability: development brief: Duration of processing component parameters. instrument: histogram unit: "s" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.lifecycle.metrics.attributes - attributes: - - ref: aspnetcore.components.type - requirement_level: required - - - id: metric.aspnetcore.components.update_parameters.exceptions - type: metric - metric_name: aspnetcore.components.update_parameters.exceptions - stability: development - brief: Total number of exceptions during processing component parameters. - instrument: counter - unit: "{exception}" - note: | - Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.lifecycle.metrics.attributes + 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: required + requirement_level: + conditionally_required: If handler has ended with an error. - - id: metric.aspnetcore.components.rendering.batch.duration + - id: metric.aspnetcore.components.render_diff type: metric - metric_name: aspnetcore.components.rendering.batch.duration + metric_name: aspnetcore.components.render_diff stability: development - brief: Duration of rendering batch. + brief: Duration of rendering difference batch between previous and current HTML. instrument: histogram unit: "s" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.lifecycle.metrics.attributes + More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) attributes: - - ref: aspnetcore.components.diff.approximate.length + - ref: aspnetcore.components.diff.length requirement_level: required - - - id: metric.aspnetcore.components.rendering.batch.exceptions - type: metric - metric_name: aspnetcore.components.rendering.batch.exceptions - stability: development - brief: Total number of exceptions during batch rendering. - instrument: counter - unit: "{exception}" - note: | - Meter name: `Microsoft.AspNetCore.Components.Lifecycle`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.lifecycle.metrics.attributes - attributes: - ref: error.type brief: The full name of exception type. examples: ['System.OperationCanceledException', 'Contoso.MyException'] - requirement_level: required + requirement_level: + conditionally_required: If handler has ended with an error. # Blazor circuits - - id: metric.aspnetcore.components.circuits.count + - id: metric.aspnetcore.components.circuit.duration type: metric - metric_name: aspnetcore.components.circuits.count + metric_name: aspnetcore.components.circuit.duration stability: development - brief: Total number of circuits. - instrument: counter - unit: "{circuit}" - note: | + 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 - extends: aspnetcore.components.circuits.metrics.attributes + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) - - id: metric.aspnetcore.components.circuits.active_circuits + - id: metric.aspnetcore.components.circuit.active type: metric - metric_name: aspnetcore.components.circuits.active_circuits + metric_name: aspnetcore.components.circuit.active stability: development - brief: Number of active circuits. + brief: Number of circuits in memory, both connected and waiting for re-connect. instrument: updowncounter unit: "{circuit}" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.circuits.metrics.attributes + More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr) - - id: metric.aspnetcore.components.circuits.connected_circuits + - id: metric.aspnetcore.components.circuit.connected type: metric - metric_name: aspnetcore.components.circuits.connected_circuits + metric_name: aspnetcore.components.circuit.connected stability: development brief: Number of connected circuits. instrument: updowncounter unit: "{circuit}" - note: | + note: > Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.circuits.metrics.attributes - - - id: metric.aspnetcore.components.circuits.duration - type: metric - metric_name: aspnetcore.components.circuits.duration - stability: development - brief: Duration of circuit. - instrument: histogram - unit: "s" - note: | - Meter name: `Microsoft.AspNetCore.Components.Server.Circuits`; Added in: ASP.NET Core 10.0 - extends: aspnetcore.components.circuits.metrics.attributes - + 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 06a2ea8f2f..52c7ee6043 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -103,8 +103,13 @@ groups: stability: development brief: Segment of the URL that is matched to a Blazor @page component. examples: ["/weather", "/counter"] - - id: aspnetcore.components.diff.approximate.length + - id: aspnetcore.components.diff.length type: int stability: development brief: Bucketed length of the diff in Blazor rendering pipeline. examples: [10, 100, 1000] + - id: aspnetcore.components.circuit.id + type: string + stability: development + brief: Id of the Blazor circuit. + examples: ["ztOXUZxeJvS2b3ioeZ68bal8RQmQehui02CtZER"] diff --git a/model/aspnetcore/spans.yaml b/model/aspnetcore/spans.yaml new file mode 100644 index 0000000000..063dd22602 --- /dev/null +++ b/model/aspnetcore/spans.yaml @@ -0,0 +1,53 @@ +groups: + - id: span.Microsoft.AspNetCore.Components.CircuitStart + type: span + span_kind: internal + brief: + note: > + ActivitySource name: `Microsoft.AspNetCore.Components`; 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.RouteChange + 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: aspnetcore.components.attribute.name + requirement_level: required + - ref: error.type + requirement_level: + conditionally_required: if the circuit initialization failed From 39b844089bf8694172fc4dd2a747ae716659a31b Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Wed, 14 May 2025 20:14:36 +0200 Subject: [PATCH 3/7] more details --- model/aspnetcore/registry.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index 52c7ee6043..7ad0de1e17 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -87,29 +87,45 @@ groups: 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.method type: string stability: development brief: Method name of the event handler in Blazor component. + note: > + This is method name of the C# event handler. + More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) examples: ["IncrementCount"] - 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.diff.length type: int stability: development brief: Bucketed length of the diff in Blazor rendering pipeline. + note: > + This is the number of changes in the diff batch which would be applied to browser DOM. + More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) examples: [10, 100, 1000] - 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"] From 51427614d48c267195cc9c7c81d3b34d51ad2fa1 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Wed, 14 May 2025 20:17:30 +0200 Subject: [PATCH 4/7] more details --- model/aspnetcore/registry.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index 7ad0de1e17..362dab35a1 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -120,9 +120,10 @@ groups: stability: development brief: Bucketed length of the diff in Blazor rendering pipeline. note: > - This is the number of changes in the diff batch which would be applied to browser DOM. + This is approximate number of changes in the diff batch which would be applied to browser DOM. + It's bucketed so that it doesn't have high cardinality. More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) - examples: [10, 100, 1000] + examples: [1, 2, 5, 10, 100, 1000] - id: aspnetcore.components.circuit.id type: string stability: development From 7c9f4b78e80e8b0bdac081d760f768cee302d2db Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Fri, 18 Jul 2025 16:54:58 +0200 Subject: [PATCH 5/7] updates after aspnetcore API review --- model/aspnetcore/metrics.yaml | 37 ++++++++++++++++++++++++---------- model/aspnetcore/registry.yaml | 9 --------- model/aspnetcore/spans.yaml | 6 +++--- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/model/aspnetcore/metrics.yaml b/model/aspnetcore/metrics.yaml index 4b52c16c4a..1588784901 100644 --- a/model/aspnetcore/metrics.yaml +++ b/model/aspnetcore/metrics.yaml @@ -116,9 +116,9 @@ groups: requirement_level: required # blazor components - - id: metric.aspnetcore.components.navigation + - id: metric.aspnetcore.components.navigate type: metric - metric_name: aspnetcore.components.navigation + metric_name: aspnetcore.components.navigate stability: development brief: Total number of route changes. instrument: counter @@ -132,9 +132,9 @@ groups: - ref: aspnetcore.components.route requirement_level: required - - id: metric.aspnetcore.components.event_handler + - id: metric.aspnetcore.components.handle_event.duration type: metric - metric_name: aspnetcore.components.event_handler + metric_name: aspnetcore.components.handle_event.duration stability: development brief: Duration of processing browser event handler. instrument: histogram @@ -155,10 +155,10 @@ groups: requirement_level: conditionally_required: If handler has ended with an error. - - id: metric.aspnetcore.components.update_parameters + - id: metric.aspnetcore.components.update_parameters.duration type: metric - metric_name: aspnetcore.components.update_parameters - stability: development + metric_name: aspnetcore.components.update_parameters.duration + stability: development.duration brief: Duration of processing component parameters. instrument: histogram unit: "s" @@ -174,9 +174,9 @@ groups: requirement_level: conditionally_required: If handler has ended with an error. - - id: metric.aspnetcore.components.render_diff + - id: metric.aspnetcore.components.render_diff.duration type: metric - metric_name: aspnetcore.components.render_diff + metric_name: aspnetcore.components.render_diff.duration stability: development brief: Duration of rendering difference batch between previous and current HTML. instrument: histogram @@ -185,8 +185,23 @@ groups: 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: aspnetcore.components.diff.length - 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.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'] diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index 362dab35a1..abcfcff311 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -115,15 +115,6 @@ groups: 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.diff.length - type: int - stability: development - brief: Bucketed length of the diff in Blazor rendering pipeline. - note: > - This is approximate number of changes in the diff batch which would be applied to browser DOM. - It's bucketed so that it doesn't have high cardinality. - More about [Blazor rendering](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/rendering) - examples: [1, 2, 5, 10, 100, 1000] - id: aspnetcore.components.circuit.id type: string stability: development diff --git a/model/aspnetcore/spans.yaml b/model/aspnetcore/spans.yaml index 063dd22602..55335425cb 100644 --- a/model/aspnetcore/spans.yaml +++ b/model/aspnetcore/spans.yaml @@ -1,10 +1,10 @@ groups: - - id: span.Microsoft.AspNetCore.Components.CircuitStart + - id: span.Microsoft.AspNetCore.Components.Server.Circuits.StartCircuit type: span span_kind: internal brief: note: > - ActivitySource name: `Microsoft.AspNetCore.Components`; Added in: ASP.NET Core 10.0 + 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: @@ -13,7 +13,7 @@ groups: - ref: error.type requirement_level: conditionally_required: if the circuit initialization failed - - id: span.Microsoft.AspNetCore.Components.RouteChange + - id: span.Microsoft.AspNetCore.Components.Navigate type: span span_kind: internal brief: From 317def23534049df134619954c01e56d5bd04114 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Fri, 18 Jul 2025 17:38:40 +0200 Subject: [PATCH 6/7] more --- docs/dotnet/README.md | 2 +- docs/dotnet/dotnet-blazor-metrics.md | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/dotnet/README.md b/docs/dotnet/README.md index dc2be31386..f3bc37f094 100644 --- a/docs/dotnet/README.md +++ b/docs/dotnet/README.md @@ -18,4 +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*. \ No newline at end of file +* [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 index 0e7923cf37..fb4e6b6880 100644 --- a/docs/dotnet/dotnet-blazor-metrics.md +++ b/docs/dotnet/dotnet-blazor-metrics.md @@ -1,11 +1,8 @@ - - # Semantic conventions for Blazor UI framework **Status**: [Development][DocumentStatus] This article defines semantic conventions for Blazor metrics emitted by .NET components. -TODO - is this generated ? \ No newline at end of file + + From 388171d7fd504b421f7b55c6e1e5f8f3d03f8c91 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 21 Jul 2025 11:07:20 +0200 Subject: [PATCH 7/7] feedback --- model/aspnetcore/metrics.yaml | 2 +- model/aspnetcore/registry.yaml | 8 -------- model/aspnetcore/spans.yaml | 2 ++ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/model/aspnetcore/metrics.yaml b/model/aspnetcore/metrics.yaml index 304127524a..e9bb241df9 100644 --- a/model/aspnetcore/metrics.yaml +++ b/model/aspnetcore/metrics.yaml @@ -166,7 +166,7 @@ groups: attributes: - ref: aspnetcore.components.type requirement_level: required - - ref: aspnetcore.components.method + - ref: code.function.name requirement_level: required - ref: aspnetcore.components.attribute.name requirement_level: required diff --git a/model/aspnetcore/registry.yaml b/model/aspnetcore/registry.yaml index abcfcff311..ed6713e4a6 100644 --- a/model/aspnetcore/registry.yaml +++ b/model/aspnetcore/registry.yaml @@ -91,14 +91,6 @@ groups: 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.method - type: string - stability: development - brief: Method name of the event handler in Blazor component. - note: > - This is method name of the C# event handler. - More about [Blazor event handling](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling) - examples: ["IncrementCount"] - id: aspnetcore.components.attribute.name type: string stability: development diff --git a/model/aspnetcore/spans.yaml b/model/aspnetcore/spans.yaml index 55335425cb..6e1c5af995 100644 --- a/model/aspnetcore/spans.yaml +++ b/model/aspnetcore/spans.yaml @@ -46,6 +46,8 @@ groups: 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