Files
ottyl/tickets/043-histogram-by-labels-support.md
T

33 lines
1.3 KiB
Markdown

# 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.