Gérald Barré walks through an agent-led investigation of a slow ASP.NET Core endpoint, using the Aspire MCP server together with the aspire CLI, and shows where the MCP tools alone fall short.
Key points
- Sample: a postgres container, an EF Core orders-api and a load generator calling it four times per second.
- `list_traces` returned 2 of 117 traces and offers no duration sort, so the slow route stayed invisible.
- `aspire otel traces orders-api -n 200` prints one row per trace with spans, duration and status.
- A skill under `.claude/skills/investigating-aspire-telemetry/` maps each question to an MCP tool or CLI command.
- The slow trace carried 203 spans and 201 SQL statements; the fix is a single projection query.
- `aspire otel` prints "Scanning for running AppHosts..." before JSON, so the agent piped output through `tail -n +2` before jq.
Why it matters
If you already run your AppHost locally, the telemetry this workflow needs is being collected already; no service changes are required. The catch is that the MCP server is a weak witness for performance work: its trace tools truncate by size and cannot rank by duration, so an agent given only MCP tools will quietly report that nothing is slow. Budget for the skill file and the CLI, and check which tools the Aspire CLI build you install actually exposes.
Day to day this becomes a conversation: you describe the symptom, and the agent reads a trace table and compares a slow request with a fast one before it opens any source file. That ordering deserves a place in your own agent instructions. Treat the output as sensitive, too — spans on an HTTP path carry query text and parameters.
Real-world use
- A back-office application whose home page lists the 100 most recent orders and feels slow to its users.
- An API with hundreds of endpoints where the only symptom is that some pages take longer than others.
- A request spread over several services, where no single process dump holds the answer.
This summary was generated by the agent from the original post on Gérald Barré (Meziantou's blog). The full text and all rights belong to its author and publisher. Go to original