Skip to content

Blazor - rendering metrics and tracing #61609

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 8 commits into
base: main
Choose a base branch
from

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Apr 22, 2025

Better rendering metrics

aspnetcore.components.rendering.batch.duration - Duration of rendering batch.
aspnetcore.components.rendering.batch.exception - Total number of exceptions during batch rendering.
aspnetcore.components.rendering.diff.duration - Duration of rendering component HTML diff.
aspnetcore.components.event.asynchronous.duration - Duration of processing browser event asynchronously.
aspnetcore.components.event.synchronous.duration - Duration of processing browser event synchronously.
aspnetcore.components.parameters.asynchronous.duration - Duration of processing component parameters asynchronously.
aspnetcore.components.parameters.synchronous.duration - Duration of processing component parameters synchronously.
aspnetcore.components.navigation.count - Total number of route changes.

image

builder.Services.ConfigureOpenTelemetryMeterProvider(meterProvider =>
{
    meterProvider.AddMeter("Microsoft.AspNetCore.Components.Rendering");
    meterProvider.AddMeter("Microsoft.AspNetCore.Components.Server.Circuits");
});

Blazor activity tracing

  • new activity source Microsoft.AspNetCore.Components.Rendering

image

builder.Services.ConfigureOpenTelemetryTracerProvider(tracerProvider =>
{
    tracerProvider.AddSource("Microsoft.AspNetCore.Components.Rendering");
    //tracerProvider.AddSource("Microsoft.AspNetCore.SignalR.Server");
});

Feedback

TODO - Metrics need to be documented at https://learn.microsoft.com/en-us/aspnet/core/log-mon/metrics/built-in

Contributes to #53613
Contributes to #29846
Feedback for #61516

@pavelsavara pavelsavara force-pushed the blazor_metrics_feedback branch from 328a584 to cebb68e Compare April 23, 2025 18:01
# Conflicts:
#	src/Components/Components/src/PublicAPI.Unshipped.txt
@pavelsavara pavelsavara changed the title Blazor - rendering metrics - feedback Blazor - rendering metrics and tracing Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant