The Respan Langfuse instrumentor enables redirection of Langfuse traces to the Respan platform using OTEL instrumentation. Continue using standard Langfuse patterns - @observe() decorators, generation tracing, and nested traces - without code modifications.
The instrumentor supports three primary patterns: basic decorator tracing, generation-level tracking with as_type='generation', and nested traces for complex hierarchical workflows.
Install langfuse and keywordsai-instrumentation-langfuse. Set environment variables for both Respan and Langfuse credentials.
Initialize the instrumentor before importing Langfuse - this patches the HTTP client to redirect traces. Use @observe() decorators as normal and call langfuse.flush() to ensure traces are transmitted.