Distributed Tracing for AI Agents with OpenTelemetry
Your AI agent is slow — but which service, model call or tool caused it? In this video, we add end-to-end distributed tracing to a multi-agent system using OpenTelemetry and W3C Trace Context. We follow one request from the orchestrator through multiple agents and MCP servers, while preserving the same trace across every network call. You’ll learn: * What traces, spans and parent spans actually are * How the `traceparent` header works * The difference between `trace_id`, `span_id` and `parent_span_id` * How context propagates through HTTP, A2A and MCP * How to instrument FastAPI and HTTPX automatically * How to create custom spans and attributes in Python * How to find slow agents, tools and model calls The demo uses Python, FastAPI, OpenTelemetry, A2A, MCP and MLflow as the telemetry backend. Code: https://github.com/Coding-Crashkurse/Distributed-OTEL-Tracing