AI coding agents are no longer just completion engines; they plan tasks, delegate subagents, and execute shell tools autonomously. Yet without observability, these multi-turn interactions remain an impenetrable black box.
In this hands-on guide, we set up a 100% local profiling lab to inspect every LLM call, token metric, and tool invocation using GitHub Copilot CLI, OpenTelemetry (OTel), and the .NET Aspire Dashboard.
1. Core Concepts: OpenTelemetry & Aspire
What is OpenTelemetry (OTel) in GenAI?
OpenTelemetry (OTel) is the vendor-neutral Cloud Native Computing Foundation (CNCF) standard for collecting traces, metrics, and logs.
In modern LLM systems, OTel defines the GenAI Semantic Conventions (gen_ai.*), capturing:
- Spans & Traces: Hierarchical trees detailing agent orchestration (
invoke_agent), model queries (chat), and environment interactions (execute_tool). - Attributes: Exact model identifiers (
gen_ai.request.model), finish reasons (gen_ai.response.finish_reasons), and temperature. - Token Metrics: Input/output token usage and Time-To-First-Token (TTFT) latency.
Why the .NET Aspire Dashboard?
.NET Aspire is an enterprise cloud-ready stack. However, we only use its standalone, zero-cloud OTel server & telemetry dashboard.
It runs locally, accepts standard OTLP (OpenTelemetry Protocol) streams over HTTP/gRPC, and provides an immediate UI with waterfall traces, latency breakdowns, and structured span attributes without requiring any SaaS account or external backend.
2. Architecture & Telemetry Flow
The Copilot CLI acts as an OTLP producer, transmitting traces over local HTTP protobuf to Aspire’s telemetry collector on port 4318. The developer monitors the live waterfall via Aspire’s web UI on port 18888.
3. Hands-On Lab Setup
Terminal 1: Launch the Local Aspire Dashboard
Run Aspire’s standalone dashboard via npx (no .NET installation required):
|
|
Aspire will start its local OTLP collector on port 4318 and provide an authenticated web dashboard URL on http://localhost:18888.
Terminal 2: Run the Instrumented Copilot CLI
Save and run this portable, self-contained PowerShell script. It automatically provisions an isolated workspace directory, injects OTel environment variables, and launches Copilot CLI:
|
|
4. Subagent Delegation with /fleet
In Copilot CLI, the /fleet command delegates tasks to autonomous subagents running in parallel.
Here is the exact prompt executed during our benchmark:
|
|

Copilot Fusion evaluated the assignment and routed the subtasks to specialized models (such as gpt-6-luna), executing shell inspection, Git checkouts, and verification in sequence while consuming 0.7 AIC (Agent Interaction Credits).
5. Analyzing Traces in Aspire Dashboard
Navigate to http://localhost:18888 and select the Traces tab.
Trace Overview
The dashboard groups agent executions by service name (copilot-cli-fleet-test). Each run displays total elapsed time and span count:

Notice the distinct runs: the /fleet multi-agent workload took 1m 06s across 31 spans, compared to faster, single-turn prompts taking between 3s and 27s.
Detailed Span Waterfall & GenAI Metadata
Drilling into the 1m 06s trace reveals the exact execution breakdown:

Key insights visible in the timeline:
- Span Decomposition: The root
invoke_agentspan orchestrates alternatingchat gpt-6-lunainference spans (3.42s, 4.48s, 2.68s) andexecute_tool powershell pwsh.exeexecution spans (2.18s, 4.36s). - GenAI Semantic Attributes: The right panel displays standard OTel attributes:
gen_ai.operation.name:chatgen_ai.provider.name:githubgen_ai.request.model:gpt-6-lunagen_ai.response.finish_reasons:["tool_calls"]
6. Real-World Use Cases for LLM Profiling
Why does telemetry matter when building or choosing AI developer tooling?
1. Token Economics & Bottleneck Discovery
Visualizing spans separates inference latency (time spent waiting on the remote model provider) from tool execution latency (local disk I/O, compilation, slow shell commands). This enables teams to:
- Optimize prompt sizes and context windows to reduce token waste.
- Spot runaway retry loops or redundant tool calls before billing spirals.
- Track Time-To-First-Token (TTFT) and caching efficiency.
2. Understanding Agent Harnessing
A common misconception is that model capability depends solely on the underlying weights. In practice, harnessing dictates performance:
The Harnessing Effect: Two tools using the exact same model (e.g. GPT-4o or Gemini 1.5 Pro) with the exact same prompt often produce radically different output quality, execution times, and token costs.
Why?
- System Prompt Framing: The hidden system instructions preloaded into the context window.
- Tool Schema Design: How tool signatures and JSON schemas are serialized and parsed.
- Orchestration Logic: Re-prompting strategies, error recovery, and subagent delegation protocols.
Profiling with OpenTelemetry exposes the harness: you see exactly what instructions are sent, which tools are called, how many turns are taken, and where latency originates.