Observe and Debug AI Agents with OpenTelemetry
Trace every model call and tool call of an agent, read the traces, and find why a run was slow, expensive or wrong.
What you'll learn
- Trace one model call as a span named by the OpenTelemetry GenAI conventions
- Trace an agent loop as a tree of agent, chat and tool spans
- Send traces to Jaeger over OTLP and read them in its search, timeline and GenAI views
- Turn the agent's spans into token and duration metrics and query them in Prometheus
- Put a Collector between the agent and Jaeger that redacts email addresses and keeps only useful traces
- Find and fix four faults of a misbehaving agent from its traces alone
Who this is for
- • DevOps engineers deepening their expertise
- • SREs building production-grade systems
- • Backend developers expanding into infrastructure
Prerequisites
- • Comfortable with Python and the command line
- • A Mac or a Linux machine with Python 3.11 to 3.14, jq and Docker
- • An OpenAI-compatible model endpoint with tool calling, and its key
Course content
2 modules, 6 lessons, 32m of video
Module 1
3 lessons, 17 min
6 min
This lesson demonstrates how to turn a single model call into a span using OpenTelemetry, and how to read this span as data. You learn to view this span both as a single line of JSON and within the Jaeger trace viewer.
7 min
The learner implements an agent loop as a trace tree, recording parent spans for the agent run and child spans for model and tool calls. They learn how to handle tool execution in threads, record tool failures, and view the resulting trace in Jaeger.
5 min
The learner runs Jaeger in a container and sends agent spans to it using OTLP without changing the agent code. They learn to read the resulting traces through Jaeger's query interface and its web page, viewing model and tool details.
Module 2
3 lessons, 16 min
6 min
The learner converts finished spans into token counters and duration histograms, pushing them to Prometheus using OTLP. They learn to query tokens, durations, and failed tools using PromQL in the Prometheus web page.
6 min
The learner configures an OpenTelemetry Collector to sit between an AI agent and Jaeger, implementing redaction, tail sampling, and batching. The learner observes that the Collector masks email addresses and drops certain traces before they reach Jaeger.
6 min
The learner examines a single trace from a misbehaving AI agent to find four faults without reading the code. They learn to identify slow tools, loops, token blow-up, and hidden errors by comparing traces before and after applying fixes.
Get started
Start Free LessonFirst lesson is always free — no signup required
This course includes
Want all courses?
See Pro plan →Your instructor

Founder and CEO, Open Empower. About the author
More in AI Agents
All courses in this trackOpenClaw: Your First AI Agent
Deploy OpenClaw locally or on a small VPS, add real tools, create one reusable automation, and apply essential security guardrails. You'll leave with a working 'Ops Assistant' that generates a Daily Brief, creates an Action Queue, and does it all safely.
Beginner · 7 lessons · 1 h
Preview free lesson
Claude Code Masterclass: Ship Real Code with AI
Stop treating AI like a magic autocomplete and start using it like a sharp junior engineer who sits next to you — one you direct, review, and hold accountable. In 10 hands-on modules you'll master the Plan → Implement → Test → Review → Commit loop and use it to ship real, tested code with Claude Code: Best-of-N, honest test suites, safe git workflows, multimodal prompts, refactoring & docs, reusable skills, the GitHub MCP server, lifecycle hooks, and a production-readiness checklist. You stay the engineer of record — Claude proposes, you decide what ships.
Intermediate · 10 lessons · 5 h
Preview free lesson
Claude Code Bootcamp: Build Real-World Software with AI
The complete Claude Code Bootcamp by Luca Berton — thirteen hands-on modules that teach you to ship real, tested software with Claude Code. You stay the engineer of record: Claude proposes, you review and merge. Master the Plan → Implement → Test → Review → Commit loop, then apply it across GCOE prompting, CLAUDE.md brain files, Best-of-N, testing & self-review, safe Git workflows, multimodal screenshot-to-UI, constrained refactoring & docs, reusable Skills, the GitHub MCP server, lifecycle Hooks, and a five-axis production-readiness review. Includes a ten-skill reusable library and a 20-question knowledge quiz.
Intermediate · 15 lessons · 8 h
Preview free lesson