Linking Weights & Biases as a source

The Weights & Biases connector syncs your ML experiment tracking data into PostHog, including projects, runs, sweeps, reports, and artifact versions across every project in your entity.

Alpha release

The Weights & Biases source is currently in alpha. Per-step run metric history isn't synced – runs include their final summary metrics instead.

Prerequisites

You need a Weights & Biases account and an API key. API keys are personal and grant access to everything your user can see, so consider a service account for team syncs.

Adding a data source

  1. In PostHog, go to the Data pipeline page and select the Sources tab.

  2. Click + New source and then click Link next to Weights & Biases.

  3. Get your API key from wandb.ai/authorize and paste it into the API key field.

  4. Enter the Entity whose projects you want to sync. This is your W&B username or team name, the first segment of your project URLs (wandb.ai/<entity>/<project>).

  5. If you use W&B Dedicated Cloud or a self-managed server, set the Host to your deployment's URL (for example https://acme.wandb.io). Leave it empty for W&B SaaS cloud.

  6. Click Next.

  7. On the next page, select the tables you want to sync and configure the sync method and frequency. Click Import.

Once the sync completes, you can start querying your Weights & Biases data in PostHog.

Configuration

OptionTypeRequired
API keypasswordYes
Entity (username or team)textYes
Host (Dedicated Cloud or self-managed only)textNo

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
projects

A project groups the runs, sweeps, reports and artifacts for one ML workstream within the entity.

Full refresh
runs

One row per run across every project in the entity, including config, tags and summary metrics. Incremental syncs filter server-side on createdAt or heartbeatAt; pick heartbeatAt to also pick up state and metric changes on recently active runs

Incremental, Full refreshcreatedAt, heartbeatAt
sweeps

A hyperparameter search that launches and coordinates a set of runs.

Full refresh
reports

A saved report (workspace view) documenting and visualizing runs in a project.

Full refresh
artifacts

One row per artifact version across every project, walked per artifact type and collection. Projects with many run-history artifacts can make this table large

Full refresh

Sync details

  • Incremental sync – The runs table supports incremental syncs on createdAt or heartbeatAt. PostHog filters server-side, so only matching runs are fetched on each sync. Pick heartbeatAt to also pick up state and summary metric changes on recently active runs; a createdAt cursor only fetches newly created runs. The other tables are full refresh.
  • JSON columns – Run config, summaryMetrics, and systemMetrics are JSON-encoded strings, matching what the W&B API returns. Parse them in queries with JSONExtract functions.
  • Partitioning – Data is partitioned by month on the createdAt field.
  • Pagination – Uses cursor pagination. If a sync is interrupted, it resumes from the last successfully synced page.
  • Rate limits – The W&B API allows roughly 50 requests per minute on free plans and 200 on paid plans. PostHog backs off and retries automatically, but very large entities can take a while to sync.

Troubleshooting

  • Invalid API key – The key may have been revoked. Generate a new one at wandb.ai/authorize and update the source credentials.
  • Tables sync but are empty – Check the entity name. It must match the username or team that owns your projects exactly.

Community questions

Was this page useful?