How does dotnet-counters provide live performance monitoring, and what key metrics does it expose by default?
Short answer
dotnet-counters connects to a running .NET process and streams live performance counters to the console (or exports them), including built-in metrics like CPU usage, GC heap size and collection counts per generation, ThreadPool thread count and queue length, exception count, and…
Advertisement
AModel answer
dotnet-counters connects to a running .NET process and streams live performance counters to the console (or exports them), including built-in metrics like CPU usage, GC heap size and collection counts per generation, ThreadPool thread count and queue length, exception count, and (for ASP.NET Core apps) request rate and active request count -- giving a real-time operational view without needing a full profiling session.
Example
dotnet-counters monitor --process-id 1234 # Live output includes: # cpu-usage, gc-heap-size, gen-0-gc-count, threadpool-thread-count, request-rate...
Real-world example
An engineer investigating intermittent slow responses runs dotnet-counters live during a suspected incident window, immediately spotting an unusual spike in ThreadPool queue length correlating with the reported slowness.
Likely follow-ups
- How do you add custom application-specific counters using EventCounter or Meter?
- How does this compare to a full APM solution like Application Insights?
Related topics