#18043·langfuse

(feat) dashboard: cost breakdown and filters by ingestion API key

Author: ryan-dyer-spCreated Sep 29, 2026Updated Sep 29, 2026
Labelsfeature

Problem

On dashboards we can break cost down by model, but for anyone running multiple integrations/bots against one project, the natural attribution unit is the API key. There's currently no way to answer "how much is this key costing us?" from a dashboard.

The data already exists: every event is stored with the public key that ingested it (ingestion_api_key on the v4 events tables), and the events table already exposes "API Key" as a filter facet. It's only absent from the dashboard query surfaces.

Proposal

Expose the ingesting API key in v4 dashboard queries, in three places:

  1. Breakdown dimension — allow widget builders to group any measure (e.g. total cost) by API key, showing the raw public keys (pk-lf-…) as labels (consistent with how the events table filter displays them).
  2. Widget filter — add "API Key" to the per-widget filter column list on the Traces and Observations editors, backed by the existing facet values (searchable any-of dropdown, same UX as User/Session).
  3. Dashboard-wide filter — add "API Key" to the global dashboard filter bar so all Traces/Observations widgets on a dashboard can be narrowed at once. Widgets on views without the column (scores) would drop it, mirroring how "Observation Name" already behaves.

Implementation notes

Because the query engine validates filters against the view declarations (dimension-driven, no allowlist), the change is small: declare ingestionApiKey on the v2 events observations/traces views (backed by the existing column — no schema or migration changes), then wire it into the hardcoded UI filter lists. Widgets using it are automatically v2-only via requiresV2.

Workaround today

None on dashboards — you can filter by API key on the events table, then eyeball costs, or export and aggregate externally.

We've already implemented and are running this on our self-hosted instance and would be happy to open a PR if there's interest.