> 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 Canonical URL: https://posthog.com/docs/data-pipelines/sources/langfuse > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Prerequisites](#prerequisites) - [Adding a data source](#adding-a-data-source) - [Sync modes](#sync-modes) - [API versions](#api-versions) - [Configuration](#configuration) - [Supported tables](#supported-tables) - [Troubleshooting](#troubleshooting) ![](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` ![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 The Langfuse connector syncs your LLM observability data – observations, evaluation scores, 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. > **Note:** New Langfuse sources use API version v3, which doesn't include the `traces` and `sessions` tables. Trace and session data is available through the `observations` table, which includes `traceId`, `sessionId`, `userId`, `traceName`, `tags`, and `release` fields. Existing sources on v1/v2 that sync these tables continue to work until November 16, 2026. See [API versions](#api-versions) for details. ## 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](https://posthog.com/docs/data-pipelines/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them. Observations, scores, 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. Prompts also sync incrementally, using the last-updated filter. Datasets, dataset items, and models are full refresh only. On legacy v1/v2 sources, `traces` and `sessions` also support incremental sync. ## API versions New Langfuse sources use API version **v3** by default. - **v3** syncs observations, scores, prompts, datasets, dataset items, models, score configs, annotation queues, and annotation queue items. It doesn't include the `traces` or `sessions` tables. - **v1** and **v2** are deprecated and sunset on **November 16, 2026**. After that date, Langfuse Cloud stops serving the `traces` and `sessions` endpoints, and syncs for those tables fail. Trace and session data is available on v3 through the `observations` table, which includes `traceId`, `sessionId`, `userId`, `traceName`, `tags`, and `release` fields. You can reconstruct trace- or session-level views by grouping observation rows by `traceId` or `sessionId` in a [SQL insight](https://posthog.com/docs/product-analytics/sql.md). ### Migrating from v1/v2 If your source syncs `traces` or `sessions`, you need to migrate before November 16, 2026: 1. Make sure the `observations` table is syncing. 2. Update queries that use the `traces` or `sessions` table to use `observations` instead, grouping by `traceId` or `sessionId`. 3. Contact support to repin your source to v3. On the next sync, the `traces` and `sessions` schemas show as disabled and existing warehouse tables keep their data. Sources on v1/v2 that don't sync `traces` or `sessions` are automatically migrated to v3. ## 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 | | --- | --- | --- | --- | --- | | `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 | — | | `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 | — | — | | `score_configs` | Score configurations that define the name, data type, and allowed values of the scores attached to traces, observations, and sessions. | Full refresh | — | — | | `annotation_queues` | Annotation queues that collect traces, observations, or sessions for human review against a set of score configs. | Full refresh | — | — | | `annotation_queue_items` | Items in annotation queues: one trace, observation, or session waiting for or finished with human review. | Full refresh | — | — | | `experiments` | Experiment runs: one row per experiment, with its dataset and the time range and item count of its runs. | Full refresh | — | — | | `experiment_items` | Per-item results of experiment runs: the input, output, and expected output of each item, and the trace it produced. | Incremental, Full refresh | startTime | — | | `comments` | Comments that users add to traces, observations, sessions, and prompts. | 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](https://posthog.com/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.