Langfuse Instrumentor
Installation
Classes
LangfuseInstrumentor
OpenTelemetry-compliant instrumentor that patches Langfuse’s OTLP exporter to redirect traces to Respan.
Methods
Important
LangfuseInstrumentor().instrument() must be called before importing langfuse. The instrumentor patches the OTLP exporter at import time.
Usage
How it works
The instrumentor patches Langfuse’s internal OTLP HTTP exporter to intercept spans and redirect them to Respan’s ingest endpoint. Existing Langfuse decorators (@observe, langfuse.trace()) continue to work unchanged — the data is simply mirrored to Respan.
Dependencies
langfuseopentelemetry-apiopentelemetry-sdkopentelemetry-instrumentation