Tracing Agent Sessions with OpenTelemetry & Aspire

In the video, Maddie Montequila demonstrates how to use OpenTelemetry and the Aspire tool to trace and monitor AI coding agents in VS Code, providing detailed insights into their workflows through real-time telemetry data displayed in the Aspire dashboard. She showcases practical examples, including integrating telemetry with GitHub Copilot chat and a multi-language transit API app, highlighting how this setup enhances observability, debugging, and agent-driven development.

In this video, Maddie Montequila demonstrates how to gain insight into the inner workings of AI coding agents in VS Code by using OpenTelemetry (Otel) and Aspire. AI agents perform various tasks such as editing files, running commands, and calling tools, but their processes often remain opaque to users. OpenTelemetry, an industry-standard framework for telemetry data like traces, metrics, and logs, provides a way to trace and monitor these agents’ activities across distributed systems. Since AI agents function as distributed applications, Otel is well-suited to track their end-to-end workflows and provide visibility into their operations.

Aspire is introduced as a free, open-source tool designed for developing and deploying modern distributed applications. It supports multiple programming languages and resources, similar to Otel, and includes an Otel developer dashboard that allows developers to view logs, metrics, and traces in real time on their local machines. Maddie explains how to start the Aspire dashboard using its CLI and configure VS Code to emit OpenTelemetry data from GitHub Copilot chat sessions. This setup enables developers to observe detailed telemetry data about their AI agents’ tasks directly within the Aspire dashboard.

Maddie showcases a practical example by asking the AI agent to add a command palette entry in the Aspire VS Code extension to open the Aspire dashboard itself. She navigates the Aspire dashboard to explore structured logs and traces, revealing detailed information such as the AI models used, system instructions, input/output messages, and tool calls. The dashboard highlights specific AI-related telemetry with sparkles, allowing users to drill down into the context and flow of the agent’s work. Additionally, the Aspire CLI can retrieve the same telemetry data in a terminal-friendly format, facilitating further analysis or automation.

To illustrate a more comprehensive use case, Maddie presents a multi-language transit API app built with Aspire, featuring APIs for BART, New York, and Boston transit systems. She runs the Aspire dashboard for this app alongside the Copilot chat telemetry, demonstrating how Aspire visualizes resources, ports, and interactions such as Redis cache calls. This dual-dashboard setup enables developers to monitor both their AI agents and the applications they interact with, enhancing debugging, performance monitoring, and agentic development workflows.

In conclusion, Maddie encourages viewers to try out this telemetry tracing approach by consulting the VS Code tracing and Aspire dashboard documentation. The process requires only the Aspire CLI and simple VS Code settings adjustments. She also invites viewers to join the Aspire team’s regular YouTube sessions to learn more about Aspire’s capabilities. Overall, this video highlights how combining OpenTelemetry with Aspire provides powerful observability into AI agent sessions, making agent-driven development more transparent and manageable.