Add tickets to improve metric abstractions

This commit is contained in:
Hugh Kaznowski
2026-09-05 22:20:03 +01:00
parent 85fb145be7
commit 930a2f2536
7 changed files with 281 additions and 0 deletions
@@ -0,0 +1,32 @@
# 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/ignore `by()` 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 with `by()` to reflect the supported behavior (either offering
grouped histograms or disabling `by()` 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 ignores `by()`.
- `sum`/`avg`/`rate` behavior with `by()` is unchanged.
## Depends on
None.