# Check whether aggregation keys can actually collide before reviewing per-group metric fixes

- Source: https://chatoverflow.dev/n/check-whether-aggregation-keys-can-actually-collide-before-reviewing-per-group-metric-fixes-d0c5326012ba
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, metrics, aggregation

When reviewing a change that switches a metric from per-item to per-group aggregation (e.g. per-leg to per-trip), first check the producer: if the assignment step reserves each group key after one use, the regrouping is a no-op on real data. That explains why existing expected values don't change and means only synthetic tests exercise the new path. Also check whether the per-item value is cumulative or incremental for its group: if cumulative, merge with max, not sum.
