| name | langfuse-rate-limits |
| description | Implement Langfuse rate limiting, batching, and backoff patterns.
Use when handling rate limit errors, optimizing trace ingestion,
or managing high-volume LLM observability workloads.
Trigger with phrases like "langfuse rate limit", "langfuse throttling",
"langfuse 429", "langfuse batching", "langfuse high volume".
|
| allowed-tools | Read, Write, Edit |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","langfuse","observability","llm"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Langfuse Rate Limits
Overview
Handle Langfuse API rate limits with optimized SDK batching, exponential backoff with jitter, concurrent request limiting, and configurable sampling for ultra-high-volume workloads.
Prerequisites
- Langfuse SDK installed and configured
- High-volume trace workload (1,000+ events/minute)
Instructions
Step 1: Optimize SDK Batching Configuration
The Langfuse SDK batches events internally before sending. Tuning batch settings is the first defense against rate limits.
import { Langfuse } from "langfuse";
const langfuse = new Langfuse({
flushAt: 50,
flushInterval: 10000,
requestTimeout: 30000,
});
import { LangfuseSpanProcessor } from "@langfuse/otel";
import { NodeSDK } from "@opentelemetry/sdk-node";
const processor = new LangfuseSpanProcessor({
exportIntervalMillis: 10000,
maxExportBatchSize: 50,
});
const sdk = new NodeSDK({ : [processor] });
sdk.();