Microsoft Learn
learn.microsoft.com › en-us › dotnet › core › diagnostics › metrics-collection
Collect metrics - .NET | Microsoft Learn
2 weeks ago - The meter name is case-sensitive. Our sample app was metric-instr.exe, substitute this with the name of your sample app. dotnet-counters monitor -n metric-instr HatCo.HatStore
Microsoft Learn
learn.microsoft.com › en-us › dotnet › core › diagnostics › metrics
Metrics Overview - .NET | Microsoft Learn
April 17, 2025 - An overview on using metrics to monitor a .NET application
Videos
11:44
Creating Dashboards with .NET 8’s New Metrics! - YouTube
09:42
dotnet-monitor: Enabling a diagnostics sidecar in AKS - YouTube
08:49
dotnet-monitor Fundamentals - Accessing .NET Diagnostics Easier ...
29:31
Diagnosing .NET 6 issues from sidecar containers using dotnet-monitor ...
24:12
Inspecting application metrics with dotnet-monitor - YouTube
32:02
Metrics & Monitoring in Prometheus & Grafana from .NET Core - YouTube
Microsoft Learn
learn.microsoft.com › en-us › aspnet › core › log-mon › metrics › metrics
ASP.NET Core metrics | Microsoft Learn
August 14, 2024 - It works with both System.Diagnostics.Metrics based APIs and EventCounters. If the dotnet-counters tool isn't installed, run the following command: ... While the test app is running, launch dotnet-counters. The following command shows an example of dotnet-counters monitoring all metrics from ...
Andrew Lock
andrewlock.net › creating-and-consuming-metrics-with-system-diagnostics-metrics-apis
Creating and consuming metrics with System.Diagnostics.Metrics APIs
January 27, 2026 - When running in production, you'll likely want to collect your metrics using an OpenTelemetry exporter integration or another solution (e.g. Datadog can collect these metrics without requiring application changes), but for local testing dotnet-counters is a very convenient tool. dotnet-counters is a .NET tool shipped by Microsoft that you can install by running: ... Alternatively, you can specify a command to run when starting the tool, and it will monitor the target process:
Microsoft Learn
learn.microsoft.com › en-us › dotnet › core › diagnostics › metrics-instrumentation
Creating Metrics - .NET | Microsoft Learn
You can also see the metrics collection tutorial for other alternatives. If the dotnet-counters tool is not already installed, use the SDK to install it: > dotnet tool update -g dotnet-counters You can invoke the tool using the following command: dotnet-counters Tool 'dotnet-counters' (version '7.0.430602') was successfully installed. While the example app is still running, use dotnet-counters to monitor the new counter:
Microsoft Learn
learn.microsoft.com › en-us › dotnet › core › diagnostics › dotnet-monitor
dotnet-monitor diagnostic tool - .NET | Microsoft Learn
The dotnet-monitor global tool is a way to monitor .NET applications in production environments and to collect diagnostic artifacts (for example, dumps, traces, logs, and metrics) on-demand or using automated rules for collecting under specified conditions.
Microsoft Learn
learn.microsoft.com › en-us › shows › on-dotnet › inspecting-application-metrics-with-dotnet-monitor
Inspecting application metrics with dotnet-monitor | Microsoft Learn
January 12, 2021 - dotnet-monitor is a command line tool that makes it easier to get access to diagnostics information in a dotnet process.In the episode, Rich is joined by Sourabh who explains to us the importance of gathering application diagnostics and also gives us a demo of how to run dotnet-monitor in Kubernetes[01:43] - Why was dotnet-monitor created?[05:37] - dotnet-monitor setup in kubernetes[14:50] - Integrating dotnet-monitor into other tools[16:45] - Support for additional metrics and event logs[19:12] - Exposing Prometheus style metrics Useful LinksIntroducing dotnet-monitor.NET Diagnostics on GitHubCollect diagnostics in containersWhat diagnostic tools are available in .NET Core?
GitHub
github.com › dotnet › AspNetCore.Docs › blob › main › aspnetcore › log-mon › metrics › metrics.md
AspNetCore.Docs/aspnetcore/log-mon/metrics/metrics.md at main · dotnet/AspNetCore.Docs
This tutorial shows several examples of collecting and displaying metrics: Populating metrics in Grafana with OpenTelemetry and Prometheus. ... Measurements can also be associated with key-value pairs called tags that allow data to be categorized for analysis. For more information, see Multi-dimensional metrics. Create a new ASP.NET Core app with the following command: dotnet new web -o WebMetric cd WebMetric dotnet add package OpenTelemetry.Exporter.Prometheus.AspNetCore --prerelease dotnet add package OpenTelemetry.Extensions.Hosting
Author dotnet
GitHub
github.com › dotnet › dotnet-monitor › blob › main › documentation › configuration › metrics-configuration.md
dotnet-monitor/documentation/configuration/metrics-configuration.md at main · dotnet/dotnet-monitor
dotnet monitor may fail to collect System.Diagnostics.Metrics if it begins collecting the metric before the target app creates the Meter (note that this is fixed for .NET 8+ apps). Specifying a Meter is done differently than for EventCounter providers. The following example uses MyCounter1 and MyCounter2 on an EventCounter named MyProvider, as well as the MyInstrument instrument on MyCustomMeter and all instruments on the AnotherMeter meter:
Author dotnet
Microsoft Learn
learn.microsoft.com › en-us › dotnet › core › diagnostics › built-in-metrics-runtime
.NET runtime metrics - .NET | Microsoft Learn
.NET supports using any managed object as a lock, either with APIs such as Monitor.Enter or with the lock statement. If one thread already holds a lock while a second thread tries to acquire it, this is called lock contention. Available starting in: .NET 9. This metric reports the same values as calling Timer.ActiveCount.
Microsoft Learn
learn.microsoft.com › en-us › samples › azure-samples › monitor-dotnet-metrics-api › monitor-dotnet-metrics-api
Retrieve Azure Monitor metrics with .NET - Code Samples | Microsoft Learn
var odataFilterMetricDef = new ODataQuery<MetricDefinition>("name.value eq 'CpuPercentage'"); metricDefinitions = await readOnlyClient.MetricDefinitions.ListAsync(resourceUri: resourceUri, odataQuery: odataFilterMetricDef, cancellationToken: new CancellationToken());
DEV Community
dev.to › dotnet › inspecting-application-metrics-with-dotnet-monitor-3bg7
Inspecting application metrics with dotnet-monitor - DEV Community
February 3, 2021 - #dotnet #diagnostics #metrics #performance · dotnet-monitor is a command line tool that makes it easier to get access to diagnostics information in a dotnet process. In the episode, Rich is joined by Sourabh who explains to us the importance of gathering application diagnostics and also gives us a demo of how to run dotnet-monitor in Kubernetes ·
Grafana
grafana.com › grafana › dashboards › 23179-dotnet-runtime-metrics
Dotnet Runtime Metrics | Grafana Labs
Memory Usage: Monitor detailed memory metrics across different generations · To use this dashboard, you need to have the following OpenTelemetry.Instrumentation.Runtime package installed in your .NET application: <ItemGroup> <PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="{version}" /> </ItemGroup> This dashboard is designed to work with Prometheus and the OTLP Exporter. ... builder.Services.AddOpenTelemetry() .WithMetrics(metrics => { metrics // OTHER METRICS SOURCES .AddRuntimeInstrumentation();
Grafana
grafana.com › grafana › dashboards › 19297-dotnet-monitor-dashboard
dotnet-monitor dashboard | Grafana Labs
With the Prometheus data source ... in your pod. The dashboard shows the key default metrics relating to Memory, CPU, Requests and Garbage collection....
Stackify
docs.stackify.com › docs › custom-metrics-configure-for-net
How to Monitor .NET Custom Metrics with Retrace
There are two properties that can be set that will instruct the library to report a metric every minute even if you do not report any values. Applying these properties is done by changing the default settings in the API to AutoReportZero or AutoReportLastValue. Below will describe what these settings mean and when they may be useful. Example of using MetricSetting for advanced options.
my tech ramblings
mytechramblings.com › posts › getting-started-with-opentelemetry-metrics-and-dotnet-part-2
Getting started with OpenTelemetry Metrics in .NET 8. Part 2: Instrumenting the BookStore API :: my tech ramblings — A blog for writing about my techie ramblings
November 29, 2023 - In this two-part series, I’m going to show you how to use OpenTelemetry to generate custom metrics and how to visualize those metrics using Prometheus and Grafana. In part 2, I’ll demonstrate how to add OpenTelemetry Metrics to a real life .NET 8 app and how to visualize those metrics using ...