dotnet-trace-collect

Recommends and guides collection of .NET diagnostic traces across Windows, Linux, and container environments.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill dotnet-trace-collect-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-trace-collect
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-diag/skills/dotnet-trace-collect
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill dotnet-trace-collect-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Diagnosing production .NET performance issues requires choosing the right diagnostic tool for a specific runtime, OS, and deployment topology, and running the correct collection commands. This Skill removes the guesswork by mapping symptoms and environments to the appropriate tool and exact commands. ## Core Features & Use Cases - Environment-aware tool selection: Chooses between PerfView, dotnet-trace, dotnet-trace collect-linux, perfcollect, and dotnet-monitor based on runtime (.NET Framework vs modern .NET), OS, admin access, and container/Kubernetes topology. - Symptom-specific guidance: Provides tailored collection strategies for high CPU, memory leaks, excessive GC, slow requests, hangs, networking failures, and assembly loading issues, including trigger and circular-buffer configuration for long-running repros. - Container and Kubernetes support: Covers sidecar deployment of dotnet-monitor, in-container collection, kubectl cp artifact extraction, and Windows container symbol merge steps. - Use Case: A developer sees intermittent slow requests on a Linux Kubernetes pod running .NET 10. The Skill recommends dotnet-trace collect-linux with the thread-time profile and Kestrel providers, gives the exact command, and explains how to copy the trace out for analysis in PerfView. ## Quick Start Ask the assistant to help you collect a diagnostic trace for a high CPU issue on your .NET application, providing your runtime version, operating system, and deployment environment.

Frequently Asked Questions about dotnet-trace-collect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I collect a diagnostic trace for a .NET application in production?

Choose the tool based on your environment: PerfView on Windows with admin rights, dotnet-trace for cross-platform collection without admin, dotnet-trace collect-linux on .NET 10+ Linux with root, or dotnet-monitor for containers without console access. Then run the collection command targeting your process PID.

PerfView vs dotnet-trace: which should I use?

PerfView produces richer ETW-based data on Windows but requires admin privileges. dotnet-trace works cross-platform without admin but captures only managed stacks and less system-level detail. On Linux .NET 10+ with root, dotnet-trace collect-linux adds native call stacks and kernel events.

Can I collect .NET traces inside a Kubernetes pod?

Yes. With console access, run dotnet-trace or dotnet-trace collect-linux inside the container and copy the trace out with kubectl cp. Without console access, deploy dotnet-monitor as a sidecar sharing a /tmp volume and use its REST API via kubectl port-forward.

Does dotnet-trace work with .NET Framework applications?

No. dotnet-trace only supports modern .NET (.NET Core 3.0+). For .NET Framework on Windows, use PerfView, which requires admin privileges. Without admin, only process dumps via procdump or Task Manager are available for hangs and memory leaks.

How do I diagnose a memory leak in a .NET application?

Capture two process dumps as memory grows and diff them in PerfView to identify leaking objects. Combine this with a trace during the growth period for allocation tracking. For modern .NET, dump collection is delegated to the dump-collect skill.

Why is my trace file too large for long-running issues?

Long collections generate huge files. On Windows, use PerfView with /StopOn triggers that fire on the symptom (such as /StopOnPerfCounter or /StopOnGCEvent) plus /CircularMB and /BufferSizeMB so only the relevant window is preserved.