Skip to content

Add MetricsEventSource - #54333

Merged
noahfalk merged 7 commits into
dotnet:mainfrom
noahfalk:metric_event_source
Jul 7, 2021
Merged

Add MetricsEventSource#54333
noahfalk merged 7 commits into
dotnet:mainfrom
noahfalk:metric_event_source

Conversation

@noahfalk

@noahfalk noahfalk commented Jun 17, 2021

Copy link
Copy Markdown
Member

The feature is still a work in progress but wanted to let others
see it in its current state while I am refining it.

Our out-of-process tools like dotnet-counters and dotnet-monitor need
access to the metrics produced by the new Meter APIs without
requiring the app to take any dependency on a separate OpenTelemetry
library. System.Diagnostics.Metrics EventSource is a new source designed
to let those tools access this data. The EventSource includes high
performance in-proc pre-aggregation capable of observing
millions of instrument invocations/sec/thread with low CPU overhead.

This change does not create any new BCL API surface, the aggregated
data is solely exposed by subscribing to the EventSource such as
using ETW, EventPipe, Lttng, or EventListener. For anyone wanting
in-process APIs to consume the data they could either use MeterListener
for unaggregated data or a library such as OpenTelemetry for
pre-aggregated data.

Todo list:

  • - I think we need a configuration on the EventSource to limit the max number of metrics to track. This ensures that even if someone goes nuts with tags we won't accidentally OOM the app trying to insert all those aggregations into the dictionaries.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants