Agent observability and tracing
Agent observability is how you see what an agent actually did: every model call, retrieval, and tool step, with the prompt, response, latency, and cost attached. Langfuse records that as application tracing โ structured logs of each request โ so you can debug non-deterministic behavior instead of guessing.
This page is for engineers and platform teams who need to inspect production agent traffic, attribute cost, and feed traces into evaluation. If you want the steps to send your first trace, start with the tracing quickstart.
Want to see it in action? Create a free account and explore Langfuse Observability in the interactive example project.
What you can do with traces
Teams use Langfuse observability to:
- Debug a failed or low-quality agent run by inspecting the exact prompt, retrieved context, and tool calls
- Attribute token usage and cost to a user, feature, or release
- Build evaluation datasets from real production traces and score quality with LLM-as-a-Judge
- Watch cost, latency, and quality in custom dashboards and get alerts when a metric crosses a threshold
How Langfuse traces an application
A trace is one request. Nested observations record LLM generations, retrieval, tools, and your own spans. You can group related traces into sessions, tag them by user, environment, or release, and follow a request across services with custom trace IDs.
Ingest traces with the Python and JS/TS SDKs, 100+ integrations, OpenTelemetry, or an LLM gateway such as LiteLLM. SDKs send data asynchronously, so tracing does not add request latency.
Read What does a good trace look like? before you instrument a new app, and core concepts for the data model.
Getting started
Set up your first trace, then compare it against the best practices guide. If you are new to AI observability, start with core concepts and the Monitoring chapter in the Langfuse Academy.
Browse Features in the sidebar for the full list of observability features.
FAQ
Why do agents need observability?
Agents are non-deterministic, take many steps, and see mixed user intent. A run can call a model, retrieve context, and use tools in an order that is hard to reconstruct from logs. Observability records that path โ prompts, tool arguments, retrieved documents, latency, and cost โ so you can debug a bad answer, a loop, or a cost spike instead of guessing.
What is the difference between observability, tracing, and monitoring?
Observability is the ability to infer internal state from outputs. Tracing is the technique that records one request as a causal tree of observations. Monitoring is watching aggregated signals โ latency, error rate, cost, quality โ over time. Agents need all three: a trace to debug a single run, and monitoring to see whether the system is getting better or worse.
What is an agent observability platform?
It is one system that captures every agent request and turns that data into something you can debug, evaluate, and improve. The category usually includes tracing, evaluation scores, prompt management, cost tracking, and dashboards. Langfuse is an open-source example: you start with traces, then add scores, prompts, and analytics incrementally.
How do you monitor agent outputs in production?
Attach scores to live traces, then chart and alert on those scores. Online evaluators (LLM-as-a-Judge or code) score incoming traffic. User feedback โ thumbs, ratings, retries โ is stored as scores on the same traces. Dashboards show quality, cost, and latency over time. Alerts fire when a metric or boolean fail rate crosses a threshold.
What is application tracing?
Application tracing records the complete lifecycle of a request as it flows through your system. Each trace captures every operation โ model calls, retrieval steps, tool executions, and custom logic โ along with timing, inputs, outputs, and metadata. That is what lets you debug, optimize, and evaluate an agent run.
How does Langfuse compare to other tracing solutions?
Langfuse is purpose-built for agents, so it natively understands token usage, model parameters, prompt and completion pairs, and evaluation scores. Unlike general-purpose APM tools, it includes LLM-as-a-Judge evaluation, prompt management, experiments and datasets, and custom dashboards. It is also open source and can be self-hosted.
Does Langfuse add latency to my application?
No. Langfuse SDKs send tracing data asynchronously in the background. Trace events are queued locally and flushed in batches, so your application's response time is not affected.
Last edited