Recording metrics in-process using MeterListener: System.Diagnostics.Metrics APIs - Part 4 This article explains how to use the `MeterListener` type from the `System.Diagnostics.Metrics` APIs to consume and record metric values in-process within a .NET application. The author demonstrates this by creating a simple ASP.NET Core app that generates HTTP load and uses `MeterListener` to capture specific metrics, displaying them in a live-updating table with Spectre.Console. However, the article notes that for production environments, developers should use dedicated solutions like OpenTelemetry or Datadog instead of directly implementing `MeterListener`. So far in this series I've described how to create and consume metrics using dotnet-counters /creating-and-consuming-metrics-with-system-diagnostics-metrics-apis/ , how to create each of the different /creating-standard-and-observable-instruments/ system-diagnostics-metrics-apis exposed by the Instrument types System.Diagnostics.Metrics APIs, and how to use a source generator to produce values /creating-strongly-typed-metics-with-a-source-generator/ . In this post, I look at how to consume the stream of values produced by Instrument implementations in-process, using the MeterListener type.I start by describing the scenario of an app that wants to record and process a specific subset of metrics exposed via the System.Diagnostics.Metrics APIs. We'll create a simple app that generates some load, use MeterListener to listen for Instrument measurements, and display the results in a table using Spectre.Console https://spectreconsole.net/ because everyone loves Spectre.Console https://spectreconsole.net/ Note that I'm notsuggesting you use MeterListener directly in your production apps. In production, you'll likely want to use a solution like OpenTelemetry or Datadog that does all this work for you Creating the test ASP.NET Core app creating-the-test-asp-net-core-app As described above, for the purposes of this post, I created a simple "hello world" ASP.NET Core app using dotnet new web , and tweaked it so that it will send requests to itself, as long as the app is running: using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; // Very basic hello-world app var builder = WebApplication.CreateBuilder args ; var app = builder.Build ; app.MapGet "/", = "Hello World " ; var task = app.RunAsync ; // Grab the address Kestrel's listening on var address = app.Services.GetRequiredService