Langfuse × Metabase

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.

Heads up: Metabase connects to databases and warehouses — it does not ship a native Langfuse connector, and a BI warehouse is the wrong home for raw prompts and completions. Sync aggregates, trace summaries, and scores — rollups, experiments, cost records — and leave the payloads in Langfuse.

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.

1 · MCP + CLI route (AI-assisted)

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.

Best for
  • 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
Trade-offs
  • 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
2 · Pipeline route (warehouse-backed)

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.

Best for
  • 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
Trade-offs
  • 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?

For: AI engineers, platform

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)
For: On-call, AI engineers

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)
For: Eng leads, finance partners

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)
For: Product, leadership

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 csv to 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 replace or move to the pipeline for real history.
  • Trace timestamps or daily rollups are required for latency and error-rate trends.
  • mb upload csv needs 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)
MCPExample MCP client config
{
  "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.

TerminalLoad a Langfuse CSV with the Metabase CLI
# 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.csv

Can 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.

Prompt for creating a Langfuse LLM Observability Overview dashboard
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

TableGrainKey columns
llm_tracesone row per traceid, app_name, model, user_id, environment, started_at, duration_ms, status, total_tokens, cost_usd
llm_request_rollupsone row per model per app per dayapp_name, model, window_start, requests, prompt_tokens, completion_tokens, cost_usd, error_count, p95_latency_ms
llm_scoresone row per score attached to a traceid, trace_id, name, value, source, comment, created_at

Modeling advice

  • Build a clean llm_traces model 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?

MetricDefinitionNotes
p95 LLM latencyThe 95th-percentile response time of LLM calls, per model and app.Use pre-aggregated percentiles; they can't be re-averaged later.
LLM error rateFailed LLM calls divided by all calls per window.Separate provider errors from guardrail and timeout failures.
LLM requests per dayDaily LLM call volume by app, model, and environment.The denominator for every rate on this page — define it once.
Token usagePrompt 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.

p95 latency by model at rollup grainPostgreSQL

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;
Error rate by app by weekPostgreSQL

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;
Trace volume, tokens, and cost by dayPostgreSQL

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;

What are common mistakes when analyzing Langfuse in Metabase?

Syncing raw prompts and completions into the warehouse.→ Land rollups, trace summaries, and scores. Payloads are heavy, often contain user data, and belong in Langfuse; the warehouse is for trends and joins.
Averaging latency instead of using percentiles.→ LLM latency is heavily right-skewed — streaming, retries, and long completions stretch the tail. Report p50/p95/p99, and never re-average stored percentiles across windows.
Mixing playground and production traffic.→ Dev experiments and test suites can dwarf real usage. Keep environment as an explicit column and scope headline cards to production.
Building dashboards from live MCP lookups only.→ MCP is useful for exploration; durable dashboards need a database-backed model with history.

Related analytics

Related dashboards

Related integrations

FAQ

Does Metabase connect natively to Langfuse?
No. Metabase reads databases and warehouses. Sync Langfuse rollups and metadata into a database first, or upload a CSV with the Metabase CLI, then build Metabase models and dashboards on top.
Should Metabase replace Langfuse?
No — they answer different questions. Langfuse is built for engineers debugging and improving LLM behavior. Metabase is where you build governed, shareable reporting on top of the same data, and join it with revenue, product usage, and infrastructure cost.
Should I sync every raw Langfuse trace into my warehouse?
No. Sync daily rollups per app and model, trace-grain summaries (status, duration, tokens, cost), and score records. Raw prompt and response payloads are heavy, often sensitive, and unnecessary for trend reporting — keep them in the source tool and drill in there.
Can I compute latency percentiles in Metabase?
Yes, if you land the right grain. From trace-level data, percentile functions work directly. From rollups, store pre-aggregated p50/p95 per window — percentiles can't be re-averaged, so p95 latency cards should read the stored percentile at the same grain it was computed.