1.3 KiB
1.3 KiB
043 — Histogram queries ignore by() grouping, inconsistent with sum/avg/rate
Summary
PromQL evaluation (evaluate_promql, src/engine.rs) has inconsistent
grouping semantics across aggregation ops: sum/avg/rate respect the
query's by_labels and group series accordingly, but Histogram collapses
all label combinations into a single histogram regardless of by(). The
same query language should not silently vary in what by() means depending
on the aggregation used.
Scope
- Decide the intended behavior: either (a) support
by()grouping for histograms, producing one histogram per label group, or (b) explicitly reject/ignoreby()on histogram queries with a clear validation error rather than silently accepting and discarding it. - Implement the chosen behavior in
evaluate_promql's histogram branch. - Update any dashboard panel UI (
Dashboards.tsx) that lets a user combine histogram withby()to reflect the supported behavior (either offering grouped histograms or disablingby()for histogram panels).
Acceptance criteria
histogram(metric) by (label)either produces one histogram per label group (verified by a seeded fixture) or is rejected/flagged clearly at query time — it no longer silently accepts and ignoresby().sum/avg/ratebehavior withby()is unchanged.
Depends on
None.