# Sample: diagnosing latency under load from Aspire metrics with an AI agent

An Aspire application: inventory-api (ASP.NET Core, Npgsql) on PostgreSQL, and pricing-api, which it calls to
price a reservation. load-generator creates reservations and reads the stock continuously. Under this load,
reading the stock of a product is slow, although its query is trivial.

    aspire start

Then open the agent in this folder and ask:

    GET /products/{id}/stock on inventory-api takes about 170 ms under load, while the query it runs is trivial.
    The application is running under Aspire. Find out why.

.mcp.json registers the Aspire MCP server (aspire agent mcp) for Claude Code. Neither the MCP server nor the
aspire CLI exposes metrics: the agent uses dotnet-counters on the process of the resource.

.claude/skills/investigating-aspire-telemetry/SKILL.md is the skill the agent uses. Claude Code and GitHub
Copilot read it from that path as is; for Codex, move the folder to .agents/skills/.

Prerequisites: the .NET 10 SDK, Docker or Podman, jq, the Aspire CLI and dotnet-counters:

    dotnet tool install --global Aspire.Cli
    dotnet tool install --global dotnet-counters

The AppHost uses an HTTP-only launch profile (ASPIRE_ALLOW_UNSECURED_TRANSPORT=true), so it does not need the
HTTPS development certificate. Use it on a development machine only.

Stop the application with:

    aspire stop
