Repository navigation
perf(PromQL): skip histogram buckets for timestamp, start_timestamp, absent - #19738
Merged
krajorama merged 1 commit intoOct 20, 2026
Merged
Conversation
linasm
requested review from
a team,
roidelapluie and
vpranckaitis
as code owners
September 18, 2026 12:59
krajorama
reviewed
Oct 15, 2026
…nd absent Signed-off-by: linasm <[email protected]>
linasm
force-pushed
the
skip-hisotgram-buckets-for-more-functions
branch
from
October 16, 2026 13:29
ff02029 to
04b66b1
Compare
krajorama
approved these changes
Oct 20, 2026
left a comment
Member
There was a problem hiding this comment.
LGTM
LLM claims an issue with gauge histograms, but I think it's minor enough to not block this PR:
load 1m
g{case="gauge"} {{schema:0 count:4 sum:10 buckets:[1 2 1] counter_reset_hint:gauge}} {{schema:0 count:5 sum:10 buckets:[2 1 2] counter_reset_hint:gauge}}
eval instant at 1m timestamp(resets(g[5m]) > 0)
{case="gauge"} 60
eval instant at 1m absent(resets(g{case="gauge"}[5m]) > 0)
This passes on main and not on this PR.
commented
Oct 20, 2026
Contributor
Author
I could exclude queries with Besides, the issue with gauge histograms being unable to detect a reset after stripping the buckets already manifests on Anyways, I am open to making further changes, just let me know the intended direction. |
commented
Oct 20, 2026
Member
|
I'll just merge this @linasm , resets in gauges don't mean anything anyway. |
bobbyhohoho1-spec
approved these changes
Nov 7, 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.
Include
timestamp,start_timestampandabsentunderSkipHistogramBucketsoptimization as these functions do not depend on the actual histogram values (and, therefore, can benefit from skipping their buckets).Benchmark results:
Note that there are two classes of other functions that could be considered for
SkipHistogramBucketsoptimization as well (but they are not included in this PR on purpose):count_over_time,present_over_time,absent_over_time, andthe ts_of_*_over_timefamily) - it would make sense to include them. But currently, if included naively, they suffer a benchmark regression, so this would require some additional effort.Release notes for end users (ALL commits must be considered).
Reviewers should verify clarity and quality.