Overview - Langfuse (original) (raw)

Docs

Observability

SDKs

Overview

Langfuse offers two SDKs:

The Langfuse SDKs are the recommended way to create custom observations and traces and use the Langfuse prompt-management and evaluation features.

Key benefits

This section documents tracing related features of the Langfuse SDK. To use the Langfuse SDK for prompt management and evaluation, visit their respective documentation.

Requirements for self-hosted Langfuse Legacy documentation

This documentation is for the latest versions of the Langfuse SDKs.

Follow the quickstart guide to get the first trace into Langfuse. See the setup section for more details.

This section covers all detail of setting up the Langfuse SDKs. Follow the Quickstart guide to create your first trace.

The Langfuse SDKs are built on top of OpenTelemetry. This provides:

The following diagram shows how Langfuse maps to native OpenTelemetry concepts:

The Langfuse SDKs provide wrappers around OTel spans (LangfuseSpan, LangfuseGeneration) that offer convenient methods for interacting with Langfuse-specific features like scoring and media handling, while still being native OTel spans under the hood. You can also use these wrapper objects to add Langfuse trace attributes via update_trace() or use propagate_attributes() for automatic propagation to all child observations.

Langfuse maintains SDKs for Python and JavaScript/TypeScript. For other languages, you can use our OpenTelemetry endpoint to instrument your application and use the public API to use Langfuse prompt management, evaluation, and querying.

Instrumentation

To instrument your application, you can send OpenTelemetry spans to the Langfuse OTel endpoint. For this, you can use the following OpenTelemetry SDKs:

Prompt management, evaluation, and querying:

To use other Langfuse features, you can use the public API to integrate Langfuse from any runtime. We also provide a list of community-maintained SDKs here.