Skip to content

feat(ingester): forward metric rollups to the sink webhook - #2

Merged
sagnik11 merged 1 commit into
mainfrom
posthog-code/sink-forward-metrics
Jul 23, 2026
Merged

feat(ingester): forward metric rollups to the sink webhook#2
sagnik11 merged 1 commit into
mainfrom
posthog-code/sink-forward-metrics

Conversation

@sagnik11

Copy link
Copy Markdown
Member

What

Extends the best-effort sink forward so the cloud dashboard gets a complete signal:

  • forwardToSink now includes the batch's 1-minute usage rollup points as an optional metrics array (payload version: 1 unchanged — existing sinks that ignore unknown fields are unaffected). Without this, the sink only ever saw error occurrences, so any downstream error-rate computation had no request denominator.
  • /v1/metrics now forwards its rollup points too — previously that endpoint never called the sink at all, so OTLP metric-only exporters were invisible downstream.
  • Skips the fetch entirely when both arrays are empty.

The receiving side (POST /runtime/sink in the Autter cloud backend) rolls these into hourly per-service buckets.

Validation

  • npm run build (tsc) ✅

Created with PostHog Code

The sink previously received only fingerprinted occurrences, so the
cloud dashboard had error counts but no request denominator. Include
the 1-minute usage rollup points in the same sink payload (new optional
`metrics` field, version unchanged) and forward from /v1/metrics too,
which previously never reached the sink at all.

Generated-By: PostHog Code
Task-Id: 6e0925be-ecd5-42ee-9fde-895c4678bde4
@sagnik11
sagnik11 merged commit d0bdf66 into main Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant