Skip to content
langfuse-incident-runbook logo

Langfuse Incident Runbook

langfuse-incident-runbook

Troubleshoot and respond to Langfuse-related incidents and outages. Use when experiencing Langfuse outages, debugging production issues, or responding to LLM observability incidents. Trigger with phrases like "langfuse incident", "langfuse outage", "langfuse down", "langfuse production issue", "l...

SKILL.md

Full skill instructions

Langfuse Incident Runbook

Overview

Step-by-step procedures for responding to Langfuse-related incidents.

Prerequisites

  • Access to Langfuse dashboard
  • Application logs access
  • Metrics/​monitoring dashboards
  • Escalation contacts

Incident Severity Levels

SeverityDescriptionResponse TimeEscalation
P1Complete outage, no traces15 minImmediate
P2Degraded, partial data loss1 hour4 hours
P3Slow/​delayed traces4 hoursNext business day
P4Minor issues, workaround exists24 hoursBest effort

Quick Diagnostics

Step 1: Initial Assessment (2 minutes)

#!/​bin/​bash
# quick-diagnosis.sh

echo "=== Langfuse Quick Diagnosis ==="
echo "Time: $(date)"
echo ""

# 1. Check Langfuse status
echo "1. Langfuse Status:"
curl -s https://status.langfuse.com/​api/​v2/​status.json | jq '.status.description'

# 2. Check API connectivity
echo ""
echo "2. API Connectivity:"
curl -s -o /​dev/​null -w "HTTP %{http_code} in %{time_total}s\n" \
  https://cloud.langfuse.com/​api/​public/​health

# 3. Check authentication
echo ""
echo "3. Auth Test:"
AUTH=$(echo -n "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" | base64)
curl -s -o /​dev/​null -w "HTTP %{http_code}\n" \
  -H "Authorization: Basic $AUTH" \
  "https://cloud.langfuse.com/​api/​public/​traces?limit=1"

# 4. Check application health
echo ""
echo "4. Application Metrics:"
curl -s http://localhost:3000/​api/​metrics | grep langfuse | head -5

Step 2: Determine Incident Type

SymptomLikely CauseGo To
No traces appearingSDK not flushingSection A
401/​403 errorsAuthentication issueSection B
High latencyNetwork/​rate limitsSection C
Missing dataPartial failuresSection D
Complete outageLangfuse service issueSection E

Section A: Traces Not Appearing

Symptoms

  • Dashboard shows no new traces
  • No errors in application logs
  • Application functioning normally

Diagnosis Steps

// 1. Verify SDK is enabled
console.log("Langfuse enabled:", process.env.LANGFUSE_ENABLED !== "false");
console.log("Environment:", process.env.NODE_ENV);

// 2. Check for pending events
// Add this to your code temporarily
const langfuse = getLangfuse();
console.log("Pending events:", langfuse.pendingItems?.length || "unknown");

// 3. Force flush and check for errors
try {
  await langfuse.flushAsync();
  console.log("Flush successful");
} catch (error) {
  console.error("Flush failed:", error);
}

Resolution Steps

  1. Check shutdown handlers

    // Ensure shutdown is registered
    process.on("beforeExit", async () => {
      await langfuse.shutdownAsync();
    });
    
  2. Reduce batch size temporarily

    const langfuse = new Langfuse({
      flushAt: 1,        // Immediate flush
      flushInterval: 1000,
    });
    
  3. Enable debug logging

    DEBUG=langfuse* npm start
    

Section B: Authentication Errors

Symptoms

  • 401 Unauthorized errors
  • 403 Forbidden errors
  • "Invalid API key" messages

Diagnosis Steps

# 1. Verify environment variables
echo "Public key starts with: ${LANGFUSE_PUBLIC_KEY:0:10}"
echo "Secret key is set: ${LANGFUSE_SECRET_KEY:+yes}"
echo "Host: ${LANGFUSE_HOST:-https://cloud.langfuse.com}"

# 2. Test credentials directly
curl -v -X GET \
  -H "Authorization: Basic $(echo -n "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" | base64)" \
  "${LANGFUSE_HOST:-https://cloud.langfuse.com}/​api/​public/​traces?limit=1"

Resolution Steps

  1. Verify keys match project

    • Go to Langfuse Dashboard > Settings > API Keys
    • Ensure keys are from the correct project
    • Check keys haven't been revoked
  2. Check for key rotation

    • If keys were recently rotated, update all environments
    • Verify secret manager has latest values
  3. Verify host URL

    • Cloud: https://cloud.langfuse.com
    • Self-hosted: Your instance URL (no trailing slash)

Section C: High Latency / Timeouts

Symptoms

  • Slow API responses
  • Request timeouts
  • 429 Rate limit errors

Diagnosis Steps

// Check flush timing
const start = Date.now();
await langfuse.flushAsync();
console.log(`Flush took ${Date.now() - start}ms`);

// Check batch sizes
console.log("Current batch size:", langfuse.pendingItems?.length);
# Network latency test
curl -w "DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTLS: %{time_appconnect}s\nTotal: %{time_total}s\n" \
  -o /​dev/​null -s https://cloud.langfuse.com/​api/​public/​health

Resolution Steps

  1. For rate limits

    // Increase batching
    const langfuse = new Langfuse({
      flushAt: 50,
      flushInterval: 10000,
    });
    
  2. For network issues

    • Check firewall rules allow outbound HTTPS
    • Verify DNS resolution
    • Consider using a closer region (self-hosted)
  3. Implement circuit breaker

    class CircuitBreaker {
      private failures = 0;
      private lastFailure?: Date;
      private readonly threshold = 5;
      private readonly resetMs = 60000;
    
      async execute<T>(operation: () => Promise<T>): Promise<T | null> {
        if (this.isOpen()) {
          console.warn("Circuit breaker open, skipping Langfuse");
          return null;
        }
    
        try {
          const result = await operation();
          this.reset();
          return result;
        } catch (error) {
          this.recordFailure();
          throw error;
        }
      }
    
      private isOpen(): boolean {
        if (this.failures < this.threshold) return false;
        if (!this.lastFailure) return false;
        return Date.now() - this.lastFailure.getTime() < this.resetMs;
      }
    
      private recordFailure() {
        this.failures++;
        this.lastFailure = new Date();
      }
    
      private reset() {
        this.failures = 0;
        this.lastFailure = undefined;
      }
    }
    

Section D: Missing/​Partial Data

Symptoms

  • Some traces appear, others don't
  • Missing spans or generations
  • Incomplete trace data

Diagnosis Steps

// Check for errors in trace operations
const trace = langfuse.trace({ name: "test" });
console.log("Trace ID:", trace.id);

const span = trace.span({ name: "test-span" });
console.log("Span ID:", span.id);

// Verify end() is called
span.end({ output: { test: true } });
console.log("Span ended");

await langfuse.flushAsync();
console.log("Flushed");

Resolution Steps

  1. Ensure all spans are ended

    const span = trace.span({ name: "operation" });
    try {
      return await doWork();
    } finally {
      span.end(); // Always end in finally
    }
    
  2. Check for exceptions swallowing

    try {
      await langfuse.flushAsync();
    } catch (error) {
      console.error("Langfuse flush error:", error);
      // Don't swallow - log for debugging
    }
    

Section E: Langfuse Service Outage

Symptoms

  • status.langfuse.com shows issues
  • All API calls failing
  • Multiple users affected

Immediate Actions

  1. Check status page: https://status.langfuse.com

  2. Enable fallback mode

    // Graceful degradation
    const langfuse = new Langfuse({
      enabled: false, // Disable during outage
    });
    
  3. Queue events locally

    // Store events to file during outage
    const pendingEvents: any[] = [];
    
    function queueEvent(event: any) {
      pendingEvents.push({
        ...event,
        timestamp: new Date().toISOString(),
      });
    
      if (pendingEvents.length > 1000) {
        // Write to file
        fs.writeFileSync(
          `langfuse-backup-${Date.now()}.json`,
          JSON.stringify(pendingEvents)
        );
        pendingEvents.length = 0;
      }
    }
    
  4. Monitor for recovery

    # Watch status
    watch -n 30 'curl -s https://status.langfuse.com/​api/​v2/​status.json | jq .status'
    

Post-Incident Checklist

  • Verify traces are appearing in dashboard
  • Check no data was lost during incident
  • Review error rates returning to normal
  • Update incident documentation
  • Schedule post-mortem if P1/​P2
  • Update runbook with learnings

Escalation Contacts

LevelContactWhen
L1On-call engineerAll incidents
L2Platform team leadP1/​P2 unresolved 30min
L3Langfuse supportService-side issues

Resources

Next Steps

For data export and retention, see langfuse-data-handling.

More skills from Dicklesworthstone

environment-setup-guide logo
Dicklesworthstone/pi_agent_rust

environment-setup-guide

Guide developers through setting up development environments with proper tools, dependencies, and configurations

1.8K 0
View
exa-policy-guardrails logo
Dicklesworthstone/pi_agent_rust

exa-policy-guardrails

Implement Exa lint rules, policy enforcement, and automated guardrails. Use when setting up code quality rules for Exa integrations, implementing pre-commit hooks, or configuring CI policy checks for Exa best practices. Trigger with phrases like "exa policy", "exa lint", "exa guardrails", "exa be...

1.8K 0
View
documenso-ci-integration logo
Dicklesworthstone/pi_agent_rust

documenso-ci-integration

Configure CI/CD pipelines for Documenso integrations. Use when setting up automated testing, deployment pipelines, or continuous integration for Documenso projects. Trigger with phrases like "documenso CI", "documenso GitHub Actions", "documenso pipeline", "documenso automated testing".

1.8K 0
View
openrouter-model-availability logo
Dicklesworthstone/pi_agent_rust

openrouter-model-availability

Build check model availability and implement fallback chains. Use when building resilient systems or handling model outages. Trigger with phrases like 'openrouter availability', 'openrouter fallback', 'openrouter model down', 'openrouter health check'.

1.8K 0
View
langfuse-enterprise-rbac logo
Dicklesworthstone/pi_agent_rust

langfuse-enterprise-rbac

Configure Langfuse enterprise organization management and access control. Use when implementing team access controls, configuring organization settings, or setting up role-based permissions for Langfuse projects. Trigger with phrases like "langfuse RBAC", "langfuse teams", "langfuse organization"...

1.8K 0
View
cursor-compliance-audit logo
Dicklesworthstone/pi_agent_rust

cursor-compliance-audit

Execute compliance and security auditing for Cursor usage. Triggers on "cursor compliance", "cursor audit", "cursor security review", "cursor soc2", "cursor gdpr". Use when analyzing or auditing cursor compliance audit. Trigger with phrases like "cursor compliance audit", "cursor audit", "cursor".

1.8K 0
View
apollo-ci-integration logo
Dicklesworthstone/pi_agent_rust

apollo-ci-integration

Configure Apollo.io CI/CD integration. Use when setting up automated testing, continuous integration, or deployment pipelines for Apollo integrations. Trigger with phrases like "apollo ci", "apollo github actions", "apollo pipeline", "apollo ci/cd", "apollo automated tests".

1.8K 0
View
python-script logo
Dicklesworthstone/pi_agent_rust

python-script

Create robust Python automation with full logging and safety checks. Use when tasks need complex data processing, authenticated API work, conditional file operations, or error handling beyond simple shell commands.

1.8K 0
View
posthog-multi-env-setup logo
Dicklesworthstone/pi_agent_rust

posthog-multi-env-setup

Configure PostHog across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific PostHog configurations. Trigger with phrases like "posthog environments", "posthog staging", "po...

1.8K 0
View
ai-agents-architect logo
Dicklesworthstone/pi_agent_rust

ai-agents-architect

Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling.

1.8K 0
View
insecure-deserialization-checker logo
Dicklesworthstone/pi_agent_rust

insecure-deserialization-checker

Validate insecure deserialization checker operations. Auto-activating skill for Security Fundamentals. Triggers on: insecure deserialization checker, insecure deserialization checker Part of the Security Fundamentals skill category. Use when working with insecure deserialization checker functiona...

1.8K 0
View
path-traversal-finder logo
Dicklesworthstone/pi_agent_rust

path-traversal-finder

Manage path traversal finder operations. Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category. Use when working with path traversal finder functionality. Trigger with phrases like "path traversa...

1.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View