When an ERP copilot gives a wrong answer, ordinary monitoring cannot tell you why. CPU and request latency look fine. What you need is the story of one request: which prompt version ran, what the model was given, which tools it called, what each step cost, and how long it took. Langfuse records that story. The CNCF Landscape lists it under AI Native Infra › Observability as an “open source LLM engineering platform” covering observability, metrics, evals, prompt management, a playground and datasets. It is a NON CNCF tool: it is not a CNCF project, though it sits in the Landscape. It complements, and does not replace, the metrics in Prometheus and the standard tracing in OpenTelemetry.
CNCF daily · Sprint 6, post 25 of 26 · AI Native Infra (Observability) · NON CNCF
At a glance
| Category | AI Native Infra › Observability (Landscape) |
| CNCF status | NON CNCF, listed in the CNCF Landscape |
| Repository | github.com/langfuse/langfuse |
| What it records | Traces made of observations (model calls, tool calls, retrievals), with cost, latency, user and session |
| Other features | Prompt management with versions and labels, evaluations (including LLM-as-a-judge), datasets and experiments, a playground |
| SDKs | Python and JS/TS; the Python SDK is built on OpenTelemetry. Other languages can send OpenTelemetry spans to Langfuse’s endpoint |
| Self-hosted parts | Web and Worker containers, PostgreSQL, ClickHouse, Redis or Valkey, and S3 or blob storage |
| Deploy options | Docker Compose, Kubernetes with Helm, and Terraform modules for AWS, Azure and GCP are officially supported |
| Versions | The docs show Langfuse v4 server, Python SDK v5 and JS/TS SDK v6; Python SDK v5 needs Langfuse v4, and a v3 server uses Python SDK v4 |
The problem Langfuse solves
| Question | Without it | With Langfuse |
|---|---|---|
| Why was this answer wrong? | Search logs by hand | Open the trace and read each step |
| What does one conversation cost? | Add up provider bills at month end | Cost per trace, user and session |
| Which prompt version caused a regression? | Nobody knows which text was live | Traces are tied to a prompt version |
| Is quality getting better? | Opinions | Scores and datasets compared across versions |
| Where is the latency? | Guess between model and tools | Span timings per step |
| Who changed the prompt? | A code change hidden in a deploy | Versioned prompts with labels |
Key concepts
| Term | Meaning |
|---|---|
| Trace | One request or conversation, from input to final output |
| Observation | One step inside a trace, such as a generation (model call), a tool call or a retrieval |
| Session | A group of traces that belong to one conversation |
| Score | A number or label attached to a trace, from a human, a rule or a judge model |
| Prompt management | Prompts stored in Langfuse, versioned, labelled (for example production) and fetched by the app |
| Dataset and experiment | A fixed set of inputs used to compare prompt or model changes |
| LLM-as-a-judge | A model that scores outputs automatically; the Worker runs these evaluations |
| Langfuse Web and Worker | The two containers: Web serves the UI and API, the Worker ingests events in the background |
Architecture
Blue is the app and the judge model, grey is the stores and queue and teal is the Langfuse containers. Open the zoomable diagram, or download it as SVG or PNG.
| Component | Responsibility |
|---|---|
| LangGraph copilot | The application being traced. See the LangGraph brief. |
| Langfuse Web | The UI, the API and the entry point for traces. |
| Blob storage | Holds incoming events and large attachments first, which helps if ClickHouse is briefly unavailable. |
| Redis or Valkey | The job queue and cache; only a reference to the event is queued. |
| Langfuse Worker | Reads queued events, processes them and writes the results. |
| ClickHouse | Stores traces, observations and scores for fast analytics. See the ClickHouse brief. |
| PostgreSQL | Stores transactional data such as projects, users and prompts. |
| Judge model | An optional model for LLM-as-a-judge evaluations, which can be served by vLLM. |
One trace from span to dashboard
- Spans. The copilot sends model and tool spans through the SDK.
- Enqueue. Langfuse Web saves the event to blob storage and queues a reference.
- Job. The Worker picks up the job from the queue.
- Insert. The Worker processes the event and writes it to ClickHouse.
- Query. The trace view reads ClickHouse to show cost, latency and prompt version.
Open the zoomable flow diagram, or download it as SVG or PNG.
Real world: the wrong payroll answer
A user asks the ERP copilot why a leave deduction looks wrong, and the answer is wrong. The support engineer finds the session in Langfuse and opens the trace. It shows the retrieval step returned an old policy document, the model call used prompt version 14, and the tool call to the payroll API took four seconds. The fix is a data fix in retrieval, and the prompt is not the cause. The engineer adds the trace to a dataset, so the next prompt change is tested against it, and a judge-model score tracks whether similar questions stay correct.
Install Langfuse
These steps follow the Langfuse self-hosting docs and the community Helm repository. I did not run them for this post.
The quick path for a trial is Docker Compose, which the docs mark as official. It has no high availability, scaling or backups, so it is not for production.
For Kubernetes, the Helm guide lists these needs: Kubernetes v1.28 or newer (the ClickHouse operator requires it), and cert-manager and the ClickHouse operator installed once per cluster. By default the chart deploys the Langfuse containers and the data stores, and you can point it at existing PostgreSQL, ClickHouse, Redis and blob storage instead.
helm repo add langfuse https://langfuse.github.io/langfuse-k8s
helm repo update
kubectl create namespace langfuse
helm install langfuse langfuse/langfuse -n langfuse -f values.yaml
kubectl get pods -n langfuse
The community chart README says the Helm release must be named langfuse for the default values.yaml to work, and that Redis or Valkey, S3 and ClickHouse settings are given through langfuse.additionalEnv. Take the exact keys from the values.yaml of the chart version you install.
For the Sprint 6 project on AWS, the production checklist describes the shape to aim for: two replicas each of Web and Worker on Kubernetes, managed PostgreSQL, managed Redis and S3, and ClickHouse Cloud or an operator-managed ClickHouse with at least 2 CPUs and 8 GiB of memory.
Try it
Create a project in the Langfuse UI, create an API key pair, and set the environment variables the SDK docs use:
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_BASE_URL="https://langfuse.example.internal" # your self-hosted URL
pip install langfuse
Match the SDK to the server: Python SDK v5 needs Langfuse v4, and a self-hosted v3 server needs Python SDK v4.
# app.py (shape taken from the SDK docs; check the names for your SDK version)
from langfuse import observe, get_client
@observe()
def answer_leave_question(question: str) -> str:
# call the model and tools here; they appear as nested observations
return "..."
answer_leave_question("Why was my leave deducted?")
get_client().flush() # send buffered events before a short script exits
For LangGraph, Langfuse documents a LangChain-style callback handler and, because the SDK is OpenTelemetry-based, OpenTelemetry instrumentation libraries also work. I did not run either, so use the integration page for your versions.
Production reference design
- Use managed stores. Managed PostgreSQL, Redis and S3, and ClickHouse Cloud or the ClickHouse operator, as the production checklist suggests.
- Run two replicas of Web and Worker.
- Set
ENCRYPTION_KEY, serve over HTTPS, disable open sign-up and configure SSO. - Back up PostgreSQL and ClickHouse, and test restores.
- Use UTC everywhere. The docs require all infrastructure components to use UTC.
- Set a retention policy. Trace data grows fast; decide how long to keep it.
- Mask sensitive data before it reaches traces, for example with the rails from the NeMo Guardrails brief.
- Send metrics to Prometheus for Langfuse’s own health, and keep Langfuse for the LLM-specific view.
- Version prompts in Langfuse with a
productionlabel, and have the app fetch by label. - Plan upgrades. Pin versions and read the changelog, since SDK and server majors are paired.
Security
- Traces hold prompts and answers. They may contain personal data; mask at the source and restrict access by project.
- API keys. Public and secret keys are credentials; keep the secret key in a secret store and rotate it.
- Sign-up and SSO. Disable open sign-up on a self-hosted instance and use SSO.
- Encryption key. Set
ENCRYPTION_KEYas the checklist says, and back it up safely. - Network exposure. The instance receives traces from apps; expose it only to the cluster or a private network where possible.
- Judge model keys. Evaluations call a model; give that key narrow scope and a budget.
- Retention. Keep data only as long as needed.
Troubleshooting
This table is built from the Langfuse self-hosting docs and common deployment problems. I did not run Langfuse for this post, so check each entry in your environment.
| Symptom | Likely cause | How to check | Fix |
|---|---|---|---|
| No traces appear | Wrong host or keys in the app | App env vars; Web logs | Set LANGFUSE_BASE_URL, public and secret keys for the right project |
| Traces appear late | Worker behind or queue backed up | Worker logs and Redis health | Scale the Worker, check Redis and ClickHouse |
| Short script sends nothing | Events buffered when the process exits | Script ends right after the call | Call flush() before exit |
| SDK features fail on self-host | SDK major newer than the server | SDK and server versions | Python SDK v5 needs Langfuse v4; with a v3 server use Python SDK v4 |
| Helm install fails | Missing cert-manager or ClickHouse operator, or old Kubernetes | Pod events; cluster version | Install them once per cluster; use v1.28 or newer |
| Odd timestamps or errors | A component not on UTC | Database and container time zones | Set PostgreSQL, ClickHouse and containers to UTC |
| ClickHouse out of memory | Too small for the load | ClickHouse metrics | Use at least 2 CPUs and 8 GiB, then size to volume |
| Data loss worry during ClickHouse outage | Events not stored elsewhere | Blob storage config | Keep blob storage enabled; Langfuse writes events there first |
| Helm values not applied | Release not named langfuse |
helm list -n langfuse |
Use the release name the chart expects |
| Prompt fetch fails | Wrong label or key scope | Prompt name and label in the UI | Use an existing label and a key for the same project |
Usage cases
- Debugging agents. Open the trace to see which step went wrong.
- Cost control. Cost per user, feature and model.
- Prompt release process. Version, label and roll back prompts without a code deploy.
- Quality tracking. Datasets and judge-model scores across versions.
- Compliance review. An audit trail of what the assistant was asked and said.
- In the Sprint 6 project. Tracing the copilot, MCP tool calls and guardrail decisions, with a dashboard for cost and failed answers.
Operational considerations
- It has many parts. Web, Worker, PostgreSQL, ClickHouse, Redis and S3 are six things to run and upgrade; managed services reduce the load.
- Storage growth. Traces are bulky; set retention and watch ClickHouse disk.
- Sampling. If volume is high, sample routine traffic and keep all errors.
- Overlap with OpenTelemetry. You can send the same spans to a general tracing backend too; decide which is the source of truth.
- People process. Someone must review traces and failed scores each week, or the data goes unused.
- Not CNCF. It is a company-led open source project; follow its releases and licence.
Adoption
The docs describe Langfuse Cloud and self-hosting, and a third-party guide shows a Railway template. I did not verify named end users for this post, so none are listed.
Alternatives
| Solution | Model | Best suited to |
|---|---|---|
| OpenTelemetry with a tracing backend | Standard spans into your existing tracing system | Teams that want one tracing stack for everything |
| LangSmith | Hosted tracing and evaluation from the LangChain team | Teams deep in the LangChain ecosystem who accept a hosted service |
| Arize Phoenix | Open source LLM tracing and evaluation | Teams that want a lighter, notebook-friendly tool |
| Helicone and gateway-based logging | Logging at a proxy in front of the model | Teams that want request logs and cost without changing app code |
| Cloud provider tools | Managed model monitoring on one cloud | Teams already on one provider’s AI platform |
| Prometheus and Grafana only | Metrics without traces | Cost and latency totals, without per-request detail |
Strengths and limitations
| Strengths | Limitations |
|---|---|
| Traces, cost, prompts and evaluations in one place | Self-hosting runs six components |
| Built on OpenTelemetry, with SDKs and an OTel endpoint | SDK and server versions must match |
| Prompt versions tied to traces | Traces can hold sensitive data |
| Official Helm chart and Terraform modules | ClickHouse needs sizing and backups |
| Open source and self-hostable | Not a CNCF project |
| Worker-based ingestion keeps the Web path fast | Evaluations add model cost |
Recommendation
Adopt for the ERP copilot, hosted in the cluster with managed stores. Start with tracing and cost for the copilot, then move prompts into Langfuse with a production label, and add a small dataset of known-bad questions with judge-model scores, tested in CI with DeepEval. Keep Prometheus for infrastructure metrics and send OpenTelemetry spans from the rest of the platform to your general tracing backend. Mask personal data before it is traced, and set retention on day one. If you only run a prototype, Langfuse Cloud or Docker Compose avoids the operating load; if your team has no one to run ClickHouse and PostgreSQL, choose a hosted option.
References: Langfuse repository · Self-host Langfuse · Kubernetes (Helm) guide · Self-hosted production checklist · ClickHouse for self-hosted Langfuse · Platform architecture · Langfuse SDKs overview · Python SDK v3 changelog (OpenTelemetry) · langfuse-k8s community Helm chart · CNCF Landscape

