Skip to content

snuffle a20223a

Choose a tag to compare

@github-actions github-actions released this 15 Sep 11:56
· 8 commits to main since this release
a20223a
fix(metrics): improve PromQL selector windows and counter queries (#4)

* fix(metrics): preserve lookback in PostHog PromQL queries

Generated-By: PostHog Desktop
Task-Id: 52a64169-b741-47be-ab09-da69151123f8

* fix(metrics): apply MetricsQL selector and counter rules

Generated-By: PostHog Desktop
Task-Id: 52a64169-b741-47be-ab09-da69151123f8

* docs: keep PromQL compatibility wording

Generated-By: PostHog Desktop
Task-Id: 52a64169-b741-47be-ab09-da69151123f8

* fix(metrics): address review findings for MetricsQL selector windows

Copy the range result instead of compacting the engine matrix in place, so
the engine does not return the same point buffer to its pool twice.

Restore the instant SQL fast paths: the internal default_rollup of an instant
query reads the lookback window, so the fast path unwraps it to the selector.
Range fast paths cannot reproduce automatic selector windows or MetricsQL
counter calculations, so the dead range SQL paths are removed.

Keep Prometheus functions that MetricsQL does not define by carrying their
names through the MetricsQL parser. Leave the selector arguments of timestamp
and absent untouched, use the library rollup argument index, and resolve
implicit windows inside a subquery against the subquery step.

Evaluate running_sum as a post-pass over the range result instead of a
doubled subquery. Guard the rate divisor, record query stats after the NaN
filter, and update README and PERFORMANCE for the paths that run.

Generated-By: PostHog Desktop
Task-Id: 46a47e68-6b45-4bbc-9303-303608734206

* fix(metrics): keep nested running_sum through a subquery

The ClickHouse e2e test evaluates running_sum inside quantile. The outermost
running_sum still runs on the range result; a nested one runs as a subquery
that spans the range from the aligned start.

Generated-By: PostHog Desktop
Task-Id: 46a47e68-6b45-4bbc-9303-303608734206