Skip to content

Metrics for System.Runtime #85372

@JamesNK

Description

@JamesNK

Today there are event counters for System.Runtime: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/available-counters#systemruntime-counters

Metrics should be added to this area. Advantages:

  1. Metrics has new features such as tags (allows for dimensions) and histograms.
  2. Easier for tests and libraries to listen to and consume with MeterListener.
  3. Some libraries only support collecting custom counters that use System.Diaganostics.Metrics. For example, opentelemetry-net.

What instruments should we have?

  • Existing System.Runtime event counters provide a good starting place.
    • Some of these counters could be combined by using tags.
    • Or tags could provide more information. For example, should the exception-count counter include the exception type name as a tag? Then tooling can provide a breakdown of not just the total exception count but the exception count grouped by type.
  • OpenTelemetry has specs with conventions for counters that a system provides. We should try to provide the same data. Note that counter and tag names don't need to match. We should use .NET conventions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Diagnostics.MetricenhancementProduct code improvement that does NOT require public API changes/additionsfeature-requestin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions