Set up comprehensive observability for Langfuse with metrics, dashboards, and alerts.
Use when implementing monitoring for LLM operations, setting up dashboards,
or configuring alerting for Langfuse integration health.
Trigger with phrases like "langfuse monitoring", "langfuse metrics",
"langfuse observability", "monitor langfuse", "langfuse alerts", "langfuse dashboard".
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Set up comprehensive observability for Langfuse with metrics, dashboards, and alerts.
Use when implementing monitoring for LLM operations, setting up dashboards,
or configuring alerting for Langfuse integration health.
Trigger with phrases like "langfuse monitoring", "langfuse metrics",
"langfuse observability", "monitor langfuse", "langfuse alerts", "langfuse dashboard".
Designed for Claude Code, also compatible with Codex and OpenClaw
Langfuse Observability
Overview
Set up monitoring for your Langfuse integration: Prometheus metrics for trace/generation throughput, Grafana dashboards, alert rules, and integration with Langfuse's built-in analytics dashboards and Metrics API.
Prerequisites
Langfuse SDK integrated and producing traces
For custom metrics: Prometheus + Grafana (or compatible stack)
For Langfuse analytics: access to the Langfuse UI dashboard
Instructions
Step 1: Langfuse Built-In Dashboards
Langfuse provides pre-built dashboards in the UI at https://cloud.langfuse.com (or your self-hosted URL):
Overview: Total traces, generations, scores, and errors
Cost Dashboard: Token usage and costs over time, broken down by model, user, session
Latency Dashboard: Response times across models and user segments
Custom Dashboards: Build your own with the query engine (multi-level aggregations, filters by user/model/tag)
Accessing via Metrics API:
import { LangfuseClient } from"@langfuse/client";
const langfuse = newLangfuseClient();
// Fetch aggregated metrics programmaticallyconst traces = await langfuse.api.traces.list({
fromTimestamp: newDate(Date.now() - 3600000).toISOString(), // Last hourlimit: 100,
});
console.log(`Traces in last hour: ${traces.data.length}`);
// Get observations with cost data
observations = langfuse...({
: ,
: (.() - ).(),
: ,
});
totalCost = observations..(
sum + (obs. || ),
);
.();
const
await
api
observations
list
type
"GENERATION"
fromTimestamp
new
Date
Date
now
86400000
toISOString
limit
500
const
data
reduce
(sum, obs) =>
calculatedTotalCost
0
0
console
log
`Total cost (24h): $${totalCost.toFixed(4)}`
Step 2: Prometheus Metrics for Your App
Track the health of your Langfuse integration with custom Prometheus metrics: