Skip to content

Add new Blazor metrics for Net10 #2235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions docs/dotnet/dotnet-blazor-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--- Hugo front matter used to generate the website version of this page:
linkTitle: Blazor
--->

# 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 ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, check out https://github.com/open-telemetry/semantic-conventions/blob/main/CONTRIBUTING.md#2-update-the-markdown-files and you can use other md files as examples, e.g.

<!-- semconv metric.aspnetcore.routing.match_attempts -->

we don't have it yaml (yet), but we should document recommended boundaries for histograms - e.g. like here https://github.com/open-telemetry/semantic-conventions/blob/main/docs/dotnet/dotnet-http-metrics.md#metric-httpclientrequesttime_in_queue

112 changes: 112 additions & 0 deletions model/aspnetcore/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,115 @@ 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
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_handler
type: metric
metric_name: aspnetcore.components.event_handler
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: aspnetcore.components.method
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
type: metric
metric_name: aspnetcore.components.update_parameters
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
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
type: metric
metric_name: aspnetcore.components.render_diff
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: 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.

# 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)
47 changes: 47 additions & 0 deletions model/aspnetcore/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,50 @@ groups:
stability: stable
brief: ASP.NET Core exception middleware handling result
examples: ["handled", "unhandled"]
- id: aspnetcore.components.type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a type of a specific component, right? If I understand correctly, the goal is to stay consistent with Ms.AspMetCore.Components namespace, but on the telemetry, in the context of specific component, it looks confusing, so suggesting

Suggested change
- id: aspnetcore.components.type
- id: aspnetcore.component.type

OTel suggests not to use plural form in metric namespaces - https://github.com/open-telemetry/semantic-conventions/blob/1000be4d897fafbc8554b373267992e47c1b86ac/docs/general/naming.md#pluralization

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 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
brief: Id of the Blazor circuit.
note: More about [Blazor circuits](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr)
examples: ["ztOXUZxeJvS2b3ioeZ68bal8RQmQehui02CtZER"]
53 changes: 53 additions & 0 deletions model/aspnetcore/spans.yaml
Original file line number Diff line number Diff line change
@@ -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