Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)5.8k · #14577

dotnet-trace-collect

Skill này làm gì

Skill này gợi ý công cụ chẩn đoán và lệnh thu thập cho các vấn đề hiệu năng .NET trên môi trường production, như CPU cao, bộ nhớ tăng hoặc request chậm. Skill dành cho lập trình viên và người vận hành cần dữ liệu trước khi tìm được nguyên nhân.

Khi nào nên dùng

  • ✓Khi một ứng dụng .NET trên production có CPU cao, bộ nhớ tăng, request chậm hoặc garbage collection quá nhiều.
  • ✓Khi bạn cần chọn công cụ chẩn đoán cho Windows, Linux hoặc container.
  • ✓Khi bạn muốn các lệnh để thu thập dữ liệu hiệu năng từ một ứng dụng đang chạy.

Liên kết skill

https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/dotnet-trace-collect/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/dotnet-trace-collect/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“API .NET của chúng tôi chạy trên Kubernetes dùng rất nhiều CPU vào giờ cao điểm. Tôi nên dùng công cụ nào và lệnh nào để thu thập dữ liệu?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent hỏi về triệu chứng và runtime, gợi ý công cụ phù hợp với môi trường đó, rồi đưa các bước để chạy và thu thập dữ liệu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

.NET Trace Collect

This skill helps developers diagnose production performance issues by recommending the right diagnostic tools for their environment, guiding data collection, and suggesting analysis approaches. It does not analyze code for anti-patterns or perform the analysis itself.

When to Use

  • A developer needs to investigate a production performance issue (high CPU, memory leak, slow requests, excessive GC, networking errors, etc.)
  • Choosing the right diagnostic tool for a specific runtime, OS, or deployment topology
  • Setting up and running diagnostic tool commands for data collection
  • Understanding trade-offs between available tools (e.g. PerfView vs dotnet-trace)
  • Collecting diagnostics from containerized or Kubernetes workloads

When Not to Use

  • Reviewing source code for performance anti-patterns (use a code review skill instead)
  • Benchmarking during development (e.g. BenchmarkDotNet setup)
  • Analyzing collected trace or dump files (this skill recommends tools for analysis, but does not perform it)

Inputs

Input Required Description
Symptom Yes What the developer is observing (high CPU, memory growth, slow requests, hangs, excessive GC, HTTP 5xx errors, networking timeouts, connection failures, assembly loading failures, etc.)
Runtime Yes .NET Framework or modern .NET (and version, especially whether .NET 10+)
OS Yes Windows or Linux
Deployment Yes Non-container, container, or Kubernetes
Admin privileges Recommended Whether the developer has admin/root access on the target machine
Repro characteristics Recommended Whether the issue is easy to reproduce or requires a long time to manifest

Workflow

Step 1: Understand the environment

Determine or ask the developer to clarify:

  1. Symptom: What they are observing (high CPU, memory leak, slow requests, hangs, excessive GC, HTTP 5xx errors, networking timeouts, connection failures, assembly loading failures, etc.)
  2. Runtime: .NET Framework or modern .NET? If modern .NET, which version? (Especially whether .NET 10 or later.)
  3. OS: Windows or Linux?
  4. Deployment: Running directly on the host, in a container, or in Kubernetes?
  5. Admin privileges: Do they have admin/root access on the target machine or container?
  6. Repro characteristics: Does the issue reproduce quickly, or does it take a long time to manifest?
  7. Workload context: Determine or ask the user if you are running in the context of the workload (i.e., on the same machine or connected to the same environment where the issue is occurring). If so, you can run diagnostic commands directly on their behalf. If not, provide the commands as guidance for the user to run themselves.

Use this information to select the right tool in Step 2.

Step 2: Recommend diagnostic tools

Select tools based on the environment using the priority rules below. Once a tool is selected, load the corresponding reference file for detailed command-line usage.

Tool reference lookup

Environment Reference file(s)
Windows + modern .NET + admin references/perfview.md
Windows + modern .NET, no admin references/dotnet-trace-collect.md
Windows + .NET Framework references/perfview.md
Linux + .NET 10+ + root references/dotnet-trace-collect-linux.md
Linux + pre-.NET 10 references/dotnet-trace-collect.md
Linux + native stacks needed references/perfcollect.md
Container/K8s (console access) references/dotnet-trace-collect.md (or dotnet-trace-collect-linux.md)
Container/K8s (no console) references/dotnet-monitor.md

Quick decision matrix (first-pass triage)

Environment Preferred tool Fallback / Notes
Windows + modern .NET + admin PerfView If admin is unavailable, use dotnet-trace
Windows + .NET Framework + admin PerfView Without admin, there is no trace fallback; for hangs/memory leaks, provide dump commands directly (procdump -ma or Task Manager) since dump-collect does not support .NET Framework
Linux + .NET 10+ + root dotnet-trace collect-linux Use dotnet-trace if root or kernel prerequisites are not met
Linux + pre-.NET 10 dotnet-trace Add perfcollect when native stacks are needed (requires root)
Linux container/Kubernetes Console tools if in workload context; `
Câu hỏi thường gặp

Skill có phân tích dữ liệu thu thập được không?

Không. Skill gợi ý công cụ để phân tích nhưng không tự phân tích.

Skill có hoạt động trong container không?

Có. Skill bao quát các workload container và Kubernetes.

Skill có bao quát .NET Framework không?

Có. Skill bao quát cả .NET Framework lẫn .NET hiện đại.

Chi tiết

Mô tả gốc của tác giả

Guide developers through capturing diagnostic artifacts to diagnose production .NET performance issues. Use when the user needs help choosing diagnostic tools, collecting performance data, or understanding tool trade-offs across different environments (Windows/Linux, .NET Framework/modern .NET, container/non-container).

repo: dotnet/skills

Độ phổ biến

Sao GitHub
5.8k
Vị trí xếp hạng
#14577
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự