Tool Guide · Observability
Langfuse Guide
The definitive guide to Langfuse for LLM observability — traces, prompt versions, evals, cost tracking, self-host setup, and when to pick it over Braintrust or Phoenix.
Key takeaways
- 1Distributed tracing for LLM and agent runs
- 2Prompt versioning and A/B comparison
- 3Cost and token dashboards per user/feature
- 4Eval datasets built from production traces
- 5Self-host or managed cloud
- 6SDKs for Python, JS, OpenAI drop-in wrapper
- 7Export to OpenTelemetry
Best for
- Debugging agent tool loops in production
- Tracking prompt changes over time
- Cost attribution per feature or customer
- Teams needing self-hosted observability
- Converting bad traces into eval cases
Not for
- Notebook-only prototypes with no users
- Teams wanting evals-only SaaS (see Braintrust)
- RAG retrieval forensics only (see Phoenix)
What it is
Langfuse is open-source observability for LLM applications. It answers: what prompt was used, what did the model return, what did it cost, and which tool calls failed.
The support triage case study logs every draft-to-sent diff in Langfuse — that diff log became their highest-ROI prompt improvement loop.
What to trace
Minimum fields per LLM call:
| Field | Why |
|---|---|
trace_id | Tie multi-step agent runs together |
user_id / session_id | Cost attribution |
prompt_version | Compare v3 vs v4 quality |
model | Route debugging |
input_tokens / output_tokens | Cost |
latency_ms | SLA monitoring |
tool_calls | Agent debugging |
Quick Python integration
from langfuse import Langfuse
from langfuse.decorators import observe
langfuse = Langfuse()
@observe()
def classify_ticket(body: str) -> dict:
# your LLM call here
...
Wrap agent steps with @observe() or use the OpenAI drop-in client.
n8n integration
After HTTP LLM steps, POST trace payload to Langfuse ingestion API. June 2026 n8n 1.50 adds execution log export — pipe into Langfuse for canvas-level debugging. See automation changelog.
Prompt versioning workflow
- Tag production prompt as
support-draft-v4 - Ship
v5to 10% traffic via feature flag - Compare accept rate in Langfuse dashboard
- Promote winner, archive loser
→ Human-in-the-loop automation
Self-host sketch
Docker compose with Postgres + ClickHouse + Langfuse web. Deploy on Fly.io with persistent volumes. Budget 2-3 hours first setup.
When to add Braintrust or Phoenix
- Braintrust — PM-led eval experiments, scoring rubrics, regression suites in CI
- Phoenix — deep RAG retrieval debugging, embedding drift
Many teams run Langfuse in prod and Phoenix locally for RAG dev. See comparison.
Default rule
If you ship agents or customer-facing LLM features without tracing, you are flying blind. Langfuse is the default OSS fix.
Pros and cons
Pros
- Best OSS all-round LLM observability in 2026
- Framework-agnostic (LangGraph, n8n HTTP, raw SDK)
- Generous self-host license
- Traces link prompts to business outcomes
Cons
- Self-host needs Postgres + ClickHouse appetite
- Instrumentation is engineering work upfront
- Eval UX less polished than Braintrust for PMs
Real workflows using this tool
Alternatives
Frequently asked questions
Watch
Hand-picked videos from official + trusted channels. Opens in a new tab.
Related on AIKnowHub
Comparison
Langfuse vs Braintrust vs Phoenix
Three observability options for production LLM apps — open-source tracing, eval-first SaaS, and RAG-focused OSS from Arize.
Concept
LLM Observability in Production
You can't debug what you can't see. LLM observability means tracing every prompt, token, latency spike, and failure — here's the production stack.
Concept
Evals Explained
Evals are the unit tests of AI systems. Without them you're flying blind. Here's how to build a useful eval set without going overboard.
Case Study
Case Study: Support Ticket Triage + Draft Reply Automation
How a customer-support team auto-classified 2,000 tickets/day, drafted first replies for 60% of them, and cut median first-response time from 4 hours to 12 minutes.
Interview
How would you build an evaluation suite for an LLM-powered feature?
Evals are the difference between shipping and praying. Standard interview topic in 2026.
Tool Guide
Aider Guide
Open-source terminal coding agent. Brings AI pair-programming into git-tracked repos with surgical edits and built-in commits.