Langfuse: OpenTelemetry-Based Tracing for Any Framework
Langfuse is an LLM/agent observability platform that fits multi-framework stacks well.
It emphasizes open instrumentation (including OpenTelemetry-friendly paths), self-host options, and traces that are not locked to one orchestration library.
Use this page when you want portable spans across custom loops, LangGraph, CrewAI, or mixed runtimes - and when self-hosting or open standards matter.
Create a Langfuse project (cloud or self-hosted), configure public/secret keys and host URL, instrument model and tool calls via the current Langfuse SDK decorators/clients or OTEL exporters (verify package names at build), emit nested observations per agent turn, and review traces, scores, and cost in the Langfuse UI.
Decorator-style instrumentation is also common in recent SDKs:
# Verify decorator names/imports for your langfuse major version at buildfrom langfuse.decorators import observe@observe(name="search-tool")def search(query: str) -> str: return "demo result"
OpenTelemetry path (when you already standardize on OTEL collectors):
# Pattern only - package and register helpers change; verify at build.# 1) Configure OTEL exporter toward Langfuse's OTLP endpoint (if enabled for your plan/version)# 2) Instrument HTTP/framework auto-instrumentors# 3) Set agent attributes: run_id, tool.name, gen_ai.* fields where supported
Self-host when prompts and tool payloads cannot leave your network boundary.
Budget for Postgres/storage, upgrades, auth, and backup - observability platforms are production systems.
Cloud is fine for many startups if DPA, retention, and redaction match policy.
Attach thumbs-up/down, rubric scores, or automated eval results to the same trace id.
That join is how "bad answer" becomes a filterable queue, not a Slack anecdote.
Short Lambda/job workers must flush() (or equivalent) before exit.
For high QPS, sample successful traces and keep 100% of errors and high-value tenants if volume forces trade-offs.