# Sample: adding custom OpenTelemetry spans so an AI agent can see inside a request

An Aspire application: catalog-api (ASP.NET Core, Npgsql) with the whole catalog loaded in memory, on top of
PostgreSQL, and load-generator, which searches the catalog and opens product pages continuously. Under this
load, GET /search takes about 400 ms, although the only query it runs takes less than a millisecond. The
built-in instrumentation stops at the request and the query: nothing in the telemetry covers the time in
between.

    aspire start

Then open the agent in this folder and ask:

    GET /search on catalog-api takes about 400 ms under load, while the only query it runs takes less than a
    millisecond and the trace shows nothing else. The application is running under Aspire. Find out where the
    time goes.

The agent has to instrument the code before it can answer, so give it the permission to edit the sample.

.mcp.json registers the Aspire MCP server (aspire agent mcp) for Claude Code.
.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
