Skip to content

Add Metrics for Blazor #53613

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

Open
2 tasks
Tracked by #5461
danroth27 opened this issue Jan 25, 2024 · 2 comments · Fixed by #61516
Open
2 tasks
Tracked by #5461

Add Metrics for Blazor #53613

danroth27 opened this issue Jan 25, 2024 · 2 comments · Fixed by #61516
Assignees
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-server feature-observability Priority:1 Work that is critical for the release, but we could probably ship without triaged

Comments

@danroth27
Copy link
Member

danroth27 commented Jan 25, 2024

We should continue the work we started in .NET 8 of adding Metrics to ASP.NET Core by defining and implementing Metrics for Blazor.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jan 25, 2024
@javiercn javiercn added this to the .NET 9 Planning milestone Jan 26, 2024
@ghost
Copy link

ghost commented Jan 26, 2024

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one Priority:1 Work that is critical for the release, but we could probably ship without labels Jan 26, 2024
@javiercn
Copy link
Member

javiercn commented Feb 5, 2025

See https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics-instrumentation for how to create metrics.
See https://learn.microsoft.com/en-us/aspnet/core/log-mon/metrics/metrics?view=aspnetcore-9.0#create-custom-metrics for details on how to do it on ASP.NET Core.
See an example on how to add metrics 34d37ec

When defining metrics, we need to take into account https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics-instrumentation#best-practices-4

Our goal here is to define things that will help people understand what's going on the server in order to take action. Based on that here are some things that are interesting to track.

  • Number of active circuits.
    • Tells you how many active users are connected.
  • Average renders per second:
    • Tells you how much rendering activity is happening across sessions.
  • Average interaction to next render
    • Tells the average responsiveness of sessions

We might not be able to collect information on a per-circuit basis, which we might want to do through other mechanisms like activities or ETW.

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 enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-server feature-observability Priority:1 Work that is critical for the release, but we could probably ship without triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@pavelsavara @danroth27 @javiercn @mkArtakMSFT and others