MQE: Ensure we never skip buckets for histogram_stddev and histogram_stdvar - #16486
Merged
Conversation
zenador
force-pushed
the
zenador/mqe-dont-skip-buckets
branch
from
August 27, 2026 01:40
0a36c16 to
3931ca0
Compare
Contributor
Author
|
cc @krajorama |
56quarters
previously approved these changes
Aug 27, 2026
| * [BUGFIX] MQE: Fix an issue where series were joined in binary operations using the wrong labels when `group_left()`/`group_right()` were used in combination with `ignoring()`. This bug manifested as valid queries returning an error `grouping labels must ensure unique matches`. #16387 | ||
| * [BUGFIX] MQE: Fix queries and rules containing a subquery whose range is shorter than its step (e.g. `foo[10m:3d]`) failing with `last bucket must not be before first bucket`. #16442 | ||
| * [BUGFIX] MQE: Fix `sum_over_time()` over native histograms losing precision when experimental range vector splitting is enabled. The Kahan compensation of each split range was discarded instead of being carried over to the other split ranges. #16455 | ||
| * [BUGFIX] MQE: Never skip decoding histogram buckets for `histogram_stddev` and `histogram_stdvar`. #16486 |
Contributor
There was a problem hiding this comment.
nit: Can you clarify what issue this would have caused for users? Incorrect results?
Contributor
Author
There was a problem hiding this comment.
Updated, is it okay now?
56quarters
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
See title. This doesn't change most queries as we already don't skip the buckets by default, just making the intended behaviour explicit and adding tests to cover it to prevent inadvertent changes to this behaviour later. This matches what we do in Prometheus.
However, it does change queries where either
histogram_stddevorhistogram_stdvaris nested underhistogram_count,histogram_sumorhistogram_avg(for examplehistogram_sum(h * histogram_stddev(h))), as the inner selector could return histograms without buckets, causing these functions to return 0. Added this edge case in a test and updated the changelog.Which issue(s) this PR fixes or relates to
Parallel to upstream PR: prometheus/prometheus#19521
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]. If changelog entry is not needed, please add thechangelog-not-neededlabel to the PR.about-versioning.mdupdated with experimental features.