Skip to content

snuffle 89dda2a

Choose a tag to compare

@github-actions github-actions released this 23 Sep 16:40
· 3 commits to main since this release
89dda2a
feat(metrics): read the PostHog metrics4 schema (#10)

* feat(metrics): read the PostHog metrics4 schema

The posthog layout reads metrics4_samples, metrics4_series,
metrics4_attributes, and metrics4_names, and writes to metrics4_input.

metrics4_samples stores the points of one series-hour in parallel arrays.
Range reads and the range pushdown filter the points of each row to the
window and combine the rows of a series-hour with groupArrayArray. Instant
reads and histogram reads expand the arrays with ARRAY JOIN. Series
selection filters metrics4_series on the hour buckets of the window. Every
sample read adds indexHint(arrayMin(timestamp_arr) <= maxt AND
arrayMax(timestamp_arr) >= mint) for the minmax skip indexes on those
expressions.

The PostHog e2e suites and the test schema move to the metrics4 tables.

Generated-By: PostHog Desktop
Task-Id: 212188a2-7ee4-44ee-b2ae-581e72136474

* feat(metrics): read mixed native and classic histogram rows

Capture folds a complete classic histogram scrape into one native row and
writes the parts of a split scrape as plain _bucket, _count, and _sum rows.
Both forms now read together: stored component series no longer suppress the
virtual histogram series, and a stored series and a virtual series with the
same label set merge into one series by timestamp, with the stored sample
winning on a shared timestamp. The fast-path histogram check and the source
lookup are bound to the query window.

Generated-By: PostHog Desktop
Task-Id: 212188a2-7ee4-44ee-b2ae-581e72136474

* fix(metrics): sort virtual histogram series built from several sources

Capture gives each folded bound set its own series, so one label set can
collect points from several stored series that arrive ordered by series.
Sort the merged samples before the engine reads them.

Generated-By: PostHog Desktop
Task-Id: 212188a2-7ee4-44ee-b2ae-581e72136474