-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[blazor] Diagnostic metrics - OTEL names review #62754
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
Conversation
…render_diff.duration and aspnetcore.components.render_diff.size - rename aspnetcore.components.navigation to aspnetcore.components.navigate to match the trace name - rename aspnetcore.components.event_handler to aspnetcore.components.handle_event.duration to match the trace name - rename aspnetcore.components.update_parameters to aspnetcore.components.update_parameters.duration - update unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aligns Blazor diagnostic metric names with OTEL conventions, splits the render diff metric into separate duration and size histograms, and updates corresponding unit tests.
- Renamed several metrics to include
.duration
or match trace names - Added a new histogram for diff size and its bucket boundaries
- Updated unit tests to use renamed metrics and include the new batch size metric
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/Shared/Metrics/MetricsConstants.cs | Added bucket boundaries for diff length histogram |
src/Components/Components/src/ComponentsMetrics.cs | Renamed metrics, added _batchSize histogram, updated recording logic |
src/Components/Components/test/ComponentsMetricsTest.cs | Updated tests for renamed metrics and new batch size metric |
Comments suppressed due to low confidence (1)
src/Components/Components/test/ComponentsMetricsTest.cs:384
- [nitpick] Consider adding a test to verify that the batch size histogram is also recorded on error paths and that recorded values fall into expected buckets.
Assert.True(batchSizeMeasurements[0].Value > 0);
@@ -14,6 +14,9 @@ internal static class MetricsConstants | |||
// For blazor rendering, which should be very fast. | |||
public static readonly IReadOnlyList<double> BlazorRenderingSecondsBucketBoundaries = [0.000001, 0.00001, 0.0001, 0.001, 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has more buckets than other durations (18 compared to 14). I don't know if that's a problem or not, but it's an inconsistency.
@@ -20,6 +20,7 @@ internal sealed class ComponentsMetrics : IDisposable | |||
private readonly Histogram<double> _eventDuration; | |||
private readonly Histogram<double> _parametersDuration; | |||
private readonly Histogram<double> _batchDuration; | |||
private readonly Histogram<int> _batchSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that there would never be more than int.MaxValue items rendered in a batch
Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: James Newton-King <[email protected]>
aspnetcore.components.render_diff
intoaspnetcore.components.render_diff.duration
aspnetcore.components.render_diff.size
aspnetcore.components.navigation
toaspnetcore.components.navigate
to match the trace nameaspnetcore.components.event_handler
toaspnetcore.components.handle_event.duration
to match the trace nameaspnetcore.components.update_parameters
toaspnetcore.components.update_parameters.duration
Fixes #62555