> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt

# Linking Langfuse as a source - Docs

Copy page

# Linking Langfuse as a source - Docs

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70)

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d)

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

`npx @posthog/wizard warehouse`

[Learn more](/wizard.md)

![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)

![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you

**Alpha release**

This source is currently in **alpha**. The interface and available tables may change.

The Langfuse connector syncs your LLM observability data – traces, observations, evaluation scores, sessions, prompts, models, and datasets – into PostHog, so you can analyze your AI application's behavior, cost, and quality alongside your product data. It works with Langfuse Cloud (all regions) and self-hosted Langfuse instances.

## Prerequisites

You need a Langfuse project and its API key pair. API keys are project-scoped and available on all Langfuse plans. Self-hosted users also need a publicly reachable Langfuse host.

## Adding a data source

1.  In PostHog, go to the [Sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section.
2.  Click **\+ New source** and click **Link** next to this source.
3.  Enter your credentials (see [Configuration](#configuration) below) and click **Next**.
4.  Select the tables you want to sync, choose a sync method and frequency, then click **Import**.

Once the syncs are complete, you can start querying this data in PostHog.

When linking Langfuse, you'll need:

-   **Public key** and **Secret key** – find both in the Langfuse dashboard under **Project settings > API keys**.
-   **Host** – set it to your Langfuse region: `https://cloud.langfuse.com` (EU, the default), `https://us.cloud.langfuse.com` (US), `https://jp.cloud.langfuse.com` (JP), or `https://hipaa.cloud.langfuse.com` (HIPAA). Self-hosted users should set it to their own Langfuse host. Leave it blank to use Langfuse Cloud EU.

## Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

-   **Webhook** (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
-   **Incremental** – only new or updated rows are synced on each run, using a cursor field (such as an `updated_at` timestamp). Cheaper than a full refresh, but deletes aren't captured.
-   **Append only** – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
-   **Full refresh** – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See [sync methods](/docs/cdp/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them.

Traces, observations, scores, sessions, and prompts support incremental sync using Langfuse's creation/start-time filters. Each incremental run re-reads a trailing one-hour window to pick up late-arriving updates, such as traces whose aggregated metrics change as observations arrive. Prompts also sync incrementally, using the last-updated filter. Datasets, dataset items, and models are full refresh only.

## Configuration

| Option | Type | Required |
| --- | --- | --- |
| Host | text | No |
| Public key | text | Yes |
| Secret key | password | Yes |

## Supported tables

| Table | Description | Sync method | Incremental field | Primary key |
| --- | --- | --- | --- | --- |
| traces | Top-level executions of your LLM application. A trace groups the observations, scores, and metadata for one end-to-end interaction. | Incremental, Full refresh | timestamp | — |
| observations | Individual units of work within a trace: LLM generations, spans, tool calls, and events, with token usage, cost, and latency detail. | Incremental, Full refresh | startTime | — |
| scores | Evaluation scores attached to traces, observations, sessions, or experiments. The value type depends on dataType (numeric, boolean, categorical, text, or correction). | Incremental, Full refresh | timestamp | — |
| sessions | Sessions group related traces, e.g. a conversation or thread of interactions. | Incremental, Full refresh | createdAt | — |
| prompts | Prompts managed in Langfuse prompt management, one row per prompt name with its versions and labels. | Incremental, Full refresh | lastUpdatedAt | — |
| datasets | Datasets of test inputs and expected outputs used for experiments and evaluation. | Full refresh | — | — |
| dataset_items | Individual items within datasets: an input, an optional expected output, and links back to the trace or observation that sourced them. | Full refresh | — | — |
| models | Model definitions used for matching generations to models and computing token usage and USD cost. | Full refresh | — | — |

## Troubleshooting

-   If you see an invalid key error, confirm the public/secret key pair in **Project settings > API keys** and make sure the host matches your project's region – keys only work against the region they were created in.
-   Langfuse rate limits its read APIs by plan (as low as 15 requests/minute on the Hobby plan). The connector backs off and retries automatically, but large first syncs on lower plans can take a while.
-   If the host is not allowed, use a publicly reachable host.

If your sync is failing or data looks wrong, see the [Data warehouse troubleshooting guide](/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.

### Was this page useful?

HelpfulCould be better