How to expose .NET well known EventCounters to Open Telemetry

Viewed 65

Microsoft documentation lists some well known event counters. How do I expose those to an Open Telemetry collector? (using the Prometheus exporter, ideally)

1 Answers

According to the OpenTelemetry GitHub ticket Export .net event counters through OpenTelemetry, these counters aren't directly supported yet. They say:

Once EventCounter -> Metric API instrumentation lands, this would be easier. For now, you'll have to write own event counter listener, and in turn, convert them to the new Metrics API.

As of Jan. 11, 2022, this work is slated to be part of "the -contrib repo." Unfortunately, as of Sep. 2022, they're still working on it -- though it does appear to be getting close.

Related