Linking Langfuse as a source

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 of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see 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 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

OptionTypeRequired
HosttextNo
Public keytextYes
Secret keypasswordYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary 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 refreshtimestamp
observations

Individual units of work within a trace: LLM generations, spans, tool calls, and events, with token usage, cost, and latency detail.

Incremental, Full refreshstartTime
scores

Evaluation scores attached to traces, observations, sessions, or experiments. The value type depends on dataType (numeric, boolean, categorical, text, or correction).

Incremental, Full refreshtimestamp
sessions

Sessions group related traces, e.g. a conversation or thread of interactions.

Incremental, Full refreshcreatedAt
prompts

Prompts managed in Langfuse prompt management, one row per prompt name with its versions and labels.

Incremental, Full refreshlastUpdatedAt
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. If that doesn't help, contact support – we're happy to help.

Community questions

Was this page useful?

Questions about this page? or post a community question.