Creating and consuming metrics with System.Diagnostics.Metrics APIs: System.Diagnostics.Metrics APIs - Part 1 The article introduces the `System.Diagnostics.Metrics` API, which was built into .NET 6 and is also available for earlier .NET versions via a NuGet package. It explains core concepts like `Instrument` and `Meter`, describes various metric types (such as `Counter`, `UpDownCounter`, `Gauge`, and `Histogram`), and demonstrates how to use the `dotnet-counters` tool for local monitoring of these metrics. In this post I provide an introduction to the System.Diagnostics.Metrics API, show how to use dotnet-counters for local monitoring of metrics, and show how to add a custom metric to your application. The the-system-diagnostics-metrics-apis System.Diagnostics.Metrics APIs System.Diagnostics.Metrics APIs The System.Diagnostics.Metrics APIs were originally introduced as a built-in in feature in .NET 6, but are also supported in earlier versions of .NET Core and .NET Framework using the System.Diagnostics.DiagnosticSource https://www.nuget.org/packages/System.Diagnostics.DiagnosticSource/ NuGet package. The metrics APIs provide a way to both create and report on metrics generated by an application, such as simple counters, gauges, or histograms of values. I'll describe each of the available metric types later. The System.Diagnostics.Metrics APIs are designed to easily interoperate with OpenTelemetry, and so can be consumed by a large range of applications. You can also read the metrics using .NET SDK tools like dotnet-counters . The word "metric" is often used in multiple different ways. Is it a single "point" with associated "tags"? Is it the full set of the recorded values for a single concept? Is it the "aggregated" statistics for all of these points? It's common to see both meanings. In this post I mainly use "metric" to mean a stream of recordings for a single concept. There are two core concepts exposed by the System.Diagnostics.Metrics APIs. These are Instrument s and Meter s: Instrument : An instrument records the values for a single metric of interest. You might have separate Instrument s for "products sold", "invoices created", "invoice total", and "GC heap size". Meter : A Meter is a logical grouping of multiple instruments. For example, thecontains multiple System.Runtime Meter Instrument s about the workings of the runtime, while the https://learn.microsoft.com/en-us/aspnet/core/log-mon/metrics/built-in?view=aspnetcore-10.0 microsoftaspnetcorehosting contains Microsoft.AspNetCore.Hosting Meter Instrument s about the HTTP requests received by ASP.NET Core. There are also several different types of Instrument : Counter