TAI BUI
Back to curriculum
LearnPython

Agent Observability: Langfuse, Phoenix, Opik

Three open-source agent observability platforms dominate 2026. Langfuse (MIT) has 6M+ installs a month and covers tracing, prompt management, evals, and session replay. Arize Phoenix (Elastic License 2.0) goes deepest on agent-specific evals, RAG relevancy, and OpenInference auto-instrumentation. Comet Opik (Apache 2.0) adds automated prompt optimization, guardrails, and LLM-judge hallucination detection.

TIME: ~45 minutesPREREQUISITES: Phase 14 · 23 (OTel GenAI)

Learning Objectives

  • Name the three top open-source agent observability platforms and their licenses.
  • Distinguish what each one is strongest at: Langfuse (prompt mgmt + sessions), Phoenix (RAG + auto-instrumentation), Opik (optimization + guardrails).
  • Explain why 89% of organizations report having agent observability in place by 2026.
  • Implement a stdlib trace-to-dashboard pipeline with LLM-judge evaluation.

The Problem

An agent observability platform ingests spans, runs evaluations, stores prompt versions, and surfaces regressions. OTel GenAI (Lesson 23) gives you the schema for the spans, but a schema doesn't store or score anything. You still need something on the receiving end, and the three main contenders each put their weight on a different part of the lifecycle.

Warm-up0/3
1. OTel GenAI conventions define the shape of spans for LLM calls. What does a schema like that not do by itself?Warm-up
2. Your agent's spans follow the OTel GenAI conventions. What does that buy you when choosing a backend?Warm-up
3. In distributed tracing, what is a span?Warm-up

The Concept

Langfuse (MIT)

Langfuse is an open-source platform for tracing, prompt management, evaluation, and session replay, and it's the broadest of the three. It has 6M+ SDK installs a month and 19k+ GitHub stars.

  • Tracing, prompt management with versioning and a playground, evaluations (LLM-as-judge, user feedback, custom), and session replays.
  • In June 2025 the formerly commercial modules (LLM-as-a-judge, annotation queues, prompt experiments, Playground) were open-sourced under MIT.
  • Strongest for end-to-end observability with a tight prompt-management loop.

Arize Phoenix (Elastic License 2.0)

Phoenix is an open-source evaluation and drift tool with native OpenInference auto-instrumentation. It goes deeper than the others on agent-specific evaluation: trace clustering, anomaly detection, and retrieval relevancy for RAG. It pairs with the managed Arize AX for production.

It has no prompt versioning. Treat it as a behavioral-regression tool that sits alongside a broader platform, not a replacement for one. Strongest for RAG relevancy, behavioral drift, and anomaly detection.

Comet Opik (Apache 2.0)

Opik is an open-source platform built around the optimization loop. It runs automated prompt optimization through A/B experiments, enforces guardrails (PII redaction, topical constraints), and detects hallucinations with an LLM judge.

Comet's own benchmark has Opik logging and evaluating in 23.44s against Langfuse's 327.15s, a gap of about 14x. That's a vendor measuring a rival, so read it as directional. Strongest for the optimization loop, automated experimentation, and guardrail enforcement.

Datadog LLM Observability

Datadog LLM Observability is the alternative for mixed ops and ML teams that already run Datadog. It sits outside the three open-source platforms above, and since all three export OTel, Datadog integration doesn't force a choice between them.

Industry data

Per Maxim's 2026 field analysis, 89% of organizations have agent observability in place, and quality issues are the top production barrier (32% of respondents cite them). One plausible reason adoption is that high: all three platforms are open source and all of them consume OTel spans, so getting traces flowing is cheap. Read together, the two numbers say that most teams can now see what their agents do, and the biggest barrier teams report is quality.

Picking one

NeedPick
All-in-one with prompt managementLangfuse
Deep RAG evaluation + driftPhoenix
Automated optimization + guardrailsOpik
Open licensing, no Elastic License 2.0Langfuse (MIT) or Opik (Apache 2.0)
Datadog / New Relic integrationAny, since they all export OTel

Where this pattern goes wrong

  • No eval strategy. Tracing without evaluation is just expensive logging.
  • Self-rolled LLM-judge without grounding. The CRITIC pattern (Lesson 05) applies here: judges need external tools for factual verification.
  • Prompt versions not tied to traces. When prod regresses, you can't bisect to the prompt that caused it.
Check: The Concept0/27
1. What license does Langfuse ship under after the June 2025 open-sourcing of formerly commercial modules?Define
2. What is Langfuse?Define
3. In an agent observability platform, what does tracing do?Define
4. What is prompt management in an observability platform?Define
5. What is LLM-as-judge?Define
6. What does session replay let you do?Define
7. What license does Arize Phoenix ship under?Define
8. What does a RAG relevancy check measure?Define
9. What is trace clustering used for?Define
10. What license does Comet Opik ship under?Define
11. What is guardrail enforcement in these platforms?Define
12. Why does the lesson pick Langfuse for a team that wants an all-in-one with prompt management?Explain
13. What is Arize Phoenix strongest at?Explain
14. Phoenix has no prompt versioning. How does the lesson say to use it?Explain
15. Which platform is built around the optimization loop, combining A/B prompt experiments, guardrails, and LLM-judge hallucination detection?Explain
16. Why does adopting Datadog LLM Observability not force a choice among Langfuse, Phoenix, and Opik?Explain
17. Comet's benchmark has Opik logging and evaluating about 14x faster than Langfuse. Why read that as directional?Explain
18. 89% of organizations report agent observability in place. What reason does the lesson offer for adoption being that high?Explain
19. Most teams report observability, yet 32% name quality issues as the top production barrier. What do the two numbers suggest together?Explain
20. Why is tracing without evaluation considered expensive logging?Explain
21. What is the risk of a self-rolled LLM-judge with no grounding?Explain
22. What goes wrong if prompt versions are not tied to traces?Explain
23. Your team has traces and a dashboard for an agent, but users say answers are often wrong and you can't tell which runs were bad. What should you do first?Analyze
24. A team runs only Phoenix. A prompt edit ships and runs drift, but they cannot say which edit caused it. What is the gap?Analyze
25. Two vendors each publish a benchmark showing their own platform about 14x faster. How should your team decide?Design
26. A team must avoid the Elastic License 2.0 and needs automated prompt optimization plus PII redaction guardrails. Which platform fits?Design
27. You are launching an agent whose answers must be factually correct. Which eval plan fits the lesson's advice?Design

Build It

code/main.py implements a stdlib trace collector and LLM-judge evaluator. It does four things:

  • Ingests GenAI-shaped spans.
  • Groups them by session and tags failed runs (guardrail trips, low-confidence evals).
  • Scores agent responses against a rubric with a scripted LLM-judge.
  • Prints a dashboard-style summary: failure rate, top failure reasons, eval score distribution.

Run it:

python3 code/main.py

The output is per-session eval scores and failure categorization, the same kind of view Langfuse, Phoenix, and Opik give you.

Check: Build It0/4
1. In the demo run, session s002 has one chat span with status error, no tool call, and no output reference. What does the scripted judge return for it?Apply
2. Session s003 has one chat span with an output reference and 2500 tokens, no error, and no tool call. What do the scoring rules give?Apply
3. The demo ingests 4 spans for s001, 2 for s002, and 2 for s003, with one error span in total. What does the final aggregate line print?Apply
4. Session s004 has a chat span whose output reference points to nonsense text, plus a tool_call span, no errors, and 500 tokens. The scripted judge returns 1.00 and PASS. What does this show?Analyze

Use It

  • Langfuse: self-hosted or cloud. Wire it in through OTel or their SDK.
  • Arize Phoenix: self-hosted. Auto-instrument with OpenInference.
  • Comet Opik: self-hosted or cloud. Use it when you want the automated optimization loop.
  • Datadog LLM Observability: for mixed ops and ML teams that already run Datadog.

Ship It

outputs/skill-obs-platform-wiring.md picks a platform and wires traces, evals, and prompt versions into an existing agent.

Author's Note

Start with the evals, not the dashboard. Tracing without evaluation is expensive logging: you can see every run and still have no idea which ones were bad. Pick whichever platform fits your need from the table above, but write the rubric first, and ground your judge in external tools so it can't just rubber-stamp whatever the agent said.

Tie every prompt version to the traces it produced, because that link is the only way to bisect a production regression back to the change that caused it. And measure the platforms on your own corpus. The 14x benchmark gap is a vendor's number, and your workload is the only one that matters to you.

Exercises

  1. Export a week of OTel traces to Langfuse cloud (free tier). Which sessions failed? Why?
  2. Write an LLM-judge rubric for your domain (factual correctness, tone, scope adherence). Test on 50 traces.
  3. Compare Langfuse prompt versioning against Phoenix's trace clustering. Which tells you what broke faster?
  4. Read Opik's guardrail docs. Wire a PII redaction guardrail to one of your agent runs.
  5. Benchmark the three on your corpus. Ignore vendor-published numbers; measure your own.

Key Terms

TermWhat people sayWhat it actually means
Tracing"Spans collector"Ingest OTel / SDK spans; index by session
Prompt management"Prompt CMS"Versioned prompts tied to traces
LLM-as-judge"Automated eval"Separate LLM scores agent output against a rubric
Session replay"Trace playback"Step through past runs for debugging
RAG relevancy"Retrieval quality"Does the retrieved context match the query
Trace clustering"Behavioral grouping"Cluster similar runs for drift detection
Guardrail enforcement"Policy at log time"PII/toxicity/scope checks on logged content

Further Reading

Code

Ships With