How to build Langfuse dashboards in Metabase
Langfuse is an open-source LLM engineering platform for tracing, prompt management, evaluation, and cost tracking across your LLM applications. Metabase is where you turn that LLM telemetry into shared, trustworthy dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with the Langfuse MCP server and loads a CSV into Metabase with the Metabase CLI, and a durable pipeline route that syncs Langfuse rollups into a database so you can build dashboards anyone can read.
How do you connect Langfuse to Metabase?
Most teams combine both routes: use quick exports and CLI uploads for a fast first pass, then move recurring cost and quality reporting to a warehouse-backed model.
Live data in, quick analysis out
Pair the Langfuse MCP server with the Metabase CLI. Use MCP for live lookups, write a scoped result to CSV, then load it into Metabase as a ready-to-query table and model.
- Quick lookups such as "show me llm cost by model and application"
- Loading a Langfuse export into Metabase in seconds
- Spot-checks and one-off analyses without a warehouse
- Great for exploration, not governed cost or quality reporting
- Use read-only or scoped credentials wherever the server supports them
- CSV uploads are snapshots — refresh or move to the pipeline for history
Durable dashboards with history
Sync Langfuse rollups and metadata into a database or warehouse with an export pipeline or API scripts, then point Metabase at it.
- Langfuse cost and quality dashboards leaders depend on
- Joining Langfuse data with revenue, product usage, or infrastructure cost
- Long-run trends for llm cost by model and application and token usage and latency trends
- You own the refresh schedule and the rollup grain
- Sync aggregates and entities — not raw prompt/response payloads
- Cost and quality definitions must stay consistent across apps and teams
What can you analyze from Langfuse data in Metabase?
Each view below is built from traces and observations, plus the generations, scores, and sessions your sync exposes:
- LLM cost by model and application
- Token usage and latency trends
- Trace error and status breakdown
- Score and eval quality tracking
- User and session adoption
Which Langfuse dashboards should you build in Metabase?
Traffic and latency
Whether the LLM layer stays fast as usage grows.
- Requests per day by app (line)
- p50 and p95 latency by model (line)
- Slowest ops, chains, or agents (table)
- Traffic by environment (stacked bar)
Errors and failures
Where LLM calls fail and why.
- Error rate by model and app (line)
- Failures by error type (bar)
- Traces with retries or fallbacks (table)
- New failure patterns this week (table)
Token and cost signals
What the traffic costs and where it concentrates.
- Tokens per day, prompt vs. completion (stacked bar)
- Cost by model (bar)
- Cost per request trend (line)
- Most expensive apps and features (table)
Adoption and usage
Who actually uses the LLM features.
- Active users of LLM features per week (line)
- Sessions and requests per user (line)
- Usage by app or feature (bar)
- Power users and heavy tenants (table)
How do you use the Langfuse MCP server with the Metabase CLI?
Pair the Langfuse MCP server with the Metabase CLI for fast, hands-on analysis. MCP is useful for scoped lookups and summarized exports; the Metabase CLI's upload command loads CSV data into Metabase and creates a ready-to-query table and model.
Example workflow
- Ask the MCP server for a summarized slice of traces and observations for the apps and models you care about.
- Export the result as CSV, keeping stable IDs, apps, models, environments, token counts, costs, and timestamps.
- Run
mb upload csvto load it into Metabase as a table and model, then build questions and dashboards on top.
Be honest about the limits
- MCP lookups are excellent for exploration, not scheduled reporting.
- A CSV upload is a snapshot; refresh it with
mb upload replaceor move to the pipeline for real history. - Trace timestamps or daily rollups are required for latency and error-rate trends.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up Langfuse MCP and the Metabase CLI?
Langfuse MCP serverofficial
- Transport
- Hosted remote MCP via Streamable HTTP (built into every Langfuse deployment)
- Auth
- HTTP Basic with project API keys (public key as username, secret key as password)
- Best for
- Live scoped lookup and export
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login- Load data
mb upload csv --file data.csv- Requires
- An uploads database (Admin → Settings → Uploads)
{
"mcpServers": {
"langfuse": {
"url": "https://cloud.langfuse.com/api/public/mcp",
"headers": {
"Authorization": "Basic <base64 of pk-lf-...:sk-lf-...>"
}
}
}
}US region: us.cloud.langfuse.com, Japan: jp.cloud.langfuse.com; self-hosted serves the same path on your domain. Keys are project-scoped — org keys and Bearer tokens are rejected. The old langfuse/mcp-server-langfuse GitHub package is the superseded prompts-only server; the native server exposes 80+ tools including queryMetrics for usage, cost, and latency breakdowns.
# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a traces-and-observations export — creates a table AND a model
mb upload csv --file langfuse-traces-and-observations.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file langfuse-traces-and-observations.csvCan you generate a Langfuse dashboard with AI?
Yes. Use the prompt below with any assistant that can run the Langfuse MCP server and the Metabase CLI. It works end to end: if Langfuse tables already exist in Metabase it analyzes those; otherwise it pulls scoped, summarized data, loads it with mb upload csv, then builds the dashboard and caveats any metric that needs missing history.
Create a polished Metabase dashboard for Langfuse llm observability analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help engineering, product, and finance partners understand traffic, latency, error rates, token usage, cost, and adoption from Langfuse data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for langfuse tables and
models). If durable Langfuse data is already present — synced from a warehouse
or uploaded earlier — use it and skip to Step 2.
- If nothing is there, pull a scoped, summarized export with the Langfuse MCP server:
traces and observations, plus generations, scores, sessions.
Prefer aggregated or rollup views over raw traces. Write each result to a CSV,
then load it with the Metabase CLI — run "mb upload csv --file <export>.csv" so
each upload creates a table and a ready-to-query model. Use "mb upload replace
<table-id> --file <export>.csv" to refresh an existing table instead of creating
duplicates.
Step 2 — Inspect before querying:
Do not assume exact table or column names. Inspect available fields, apps, models,
environments, timestamps, and whether rollups or history exist before creating
duration or trend cards.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
Langfuse — it reads a database or CLI-uploaded tables.
- Never load raw prompt/response payloads into Metabase; use rollups, trace
summaries, and experiment- or score-grain data.
- Only compute latency percentiles and durations when the required timestamps
or pre-aggregated percentile fields exist.
- Exclude test, staging, and playground traffic from headline cost and quality
cards, and segment by environment where the field exists.
- A single CSV is a point-in-time snapshot: only build trend cards if there is a
usable date column or multiple periods have been uploaded.
Dashboard title: Langfuse LLM Observability Overview
Sections:
1. Executive summary: Requests last 7 days; p95 latency; Error rate;
Total cost last 30 days; Active users.
2. Traffic: Requests per day by app and environment; tokens per day.
3. Latency: p50/p95 by model by week; slowest ops or chains.
4. Errors: Error rate by model and app; failures by type; retries.
5. Cost and adoption: Cost by model; cost per request; active users of
LLM features.
Filters: Date range, App, Model, Environment, User or team, Status.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data.How do you sync Langfuse data into a database or warehouse?
For dashboards that need history and reliability, land Langfuse rollups and metadata in a database first, then connect Metabase to that database.
Connector options
- Direct database or export pipeline — use the vendor's storage or export path when it reaches a database you control.
- Custom pipeline — use the Langfuse public API for control over rollup grain, fields, and refresh cadence.
- MCP + CSV — use this for quick exploration and one-off slices.
Self-hosted Langfuse stores traces, observations, and scores in ClickHouse (with Postgres for transactional data) — point Metabase at ClickHouse directly for full-fidelity analysis. On Langfuse Cloud, schedule batch exports to S3 (CSV or JSON) and load rollups from there; no managed Airbyte or Fivetran connector exists.
Notes
- Decide the rollup grain first (daily per app/model is the workhorse) — it drives warehouse cost and every trend card.
- Land raw entity tables first, then build clean Metabase models on top.
- Normalize app, model, environment, status, duration, token-count, and window-start fields.
- Strip or hash prompt/response payloads and user identifiers before they reach the warehouse — cost and quality analytics don't need them.
How should you model Langfuse data in Metabase?
Core tables
| Table | Grain | Key columns |
|---|---|---|
llm_traces | one row per trace | id, app_name, model, user_id, environment, started_at, duration_ms, status, total_tokens, cost_usd |
llm_request_rollups | one row per model per app per day | app_name, model, window_start, requests, prompt_tokens, completion_tokens, cost_usd, error_count, p95_latency_ms |
llm_scores | one row per score attached to a trace | id, trace_id, name, value, source, comment, created_at |
Modeling advice
- Build a clean
llm_tracesmodel with common columns across tools, so multi-source dashboards don't fork definitions. - Separate entity tables (apps, models, datasets, prompts) from time-series rollups and trace- or score-grain tables.
- Exclude test, staging, and playground traffic from headline cost and quality metrics; keep environment as an explicit column.
- Use stable IDs for app, model, and experiment joins; display names and model aliases change.
Which Langfuse metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| p95 LLM latency | The 95th-percentile response time of LLM calls, per model and app. | Use pre-aggregated percentiles; they can't be re-averaged later. |
| LLM error rate | Failed LLM calls divided by all calls per window. | Separate provider errors from guardrail and timeout failures. |
| LLM requests per day | Daily LLM call volume by app, model, and environment. | The denominator for every rate on this page — define it once. |
| Token usage | Prompt and completion tokens per period, by model and app. | Track prompt and completion tokens separately — they're priced differently. |
What SQL powers Langfuse dashboards in Metabase?
These assume a cleaned analytical model in a warehouse (PostgreSQL dialect). Adjust table and column names to match your pipeline.
From pre-aggregated rollups — keep percentiles at the grain they were computed.
-- Keep p95 at the rollup grain it was computed. Do not MAX/AVG percentiles
-- across windows — that invents a fake weekly p95.
SELECT
model,
window_start,
p95_latency_ms,
requests
FROM llm_request_rollups
WHERE environment = 'production'
AND window_start >= CURRENT_DATE - INTERVAL '30 days'
ORDER BY window_start, model;Failed calls over all calls, production only.
SELECT
app_name,
date_trunc('week', window_start) AS week,
SUM(requests) AS requests,
SUM(error_count) AS errors,
ROUND(
100.0 * SUM(error_count) / NULLIF(SUM(requests), 0), 2
) AS error_rate_pct
FROM llm_request_rollups
WHERE environment = 'production'
GROUP BY app_name, 2
ORDER BY 2, error_rate_pct DESC;The traffic-and-cost pulse from trace summaries.
SELECT
date_trunc('day', started_at) AS day,
app_name,
COUNT(*) AS traces,
SUM(total_tokens) AS total_tokens,
ROUND(SUM(cost_usd), 2) AS cost_usd
FROM llm_traces
WHERE started_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY 1, app_name
ORDER BY 1, cost_usd DESC;