You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
querier: clamp start time for Series, LabelValues, LabelNames (#9129)
* querier: clamp start time for Series, LabelValues, LabelNames
Start and End times in Series, LabelNames, LabelValues calls are optional.
When they're unset Prometheus defaults them to MinTime (effectively MinInt)
and MaxTime (MaxInt).
Currently MaxQueryIntoFuture clamps the start time relative to now.
After that the start time is clamped relative to the end because of the max_label_query_length limit.
However with PR XXX we're preparing to remove that option, so we'll no longer
be clamping max time relative to now. Without clamping
the end time we end up clamping start to MaxTime, so the whole query is for
some (e.g.) 30 days in the year 292277025. Which usually returns no data.
What does this PR do
In this PR we're only clamping start time.
It's clamped to end time if that was provided or to now, otherwise.
We don't clamp end time because there's likely no data to query and
we don't have to think about ignoring samples with a future timestamp that have been ingested.
Not clamping end time is potentially a problem if there's large clock skew
between clients sending data and the query-frontend. I think this is very unlikely to cause problems.
Signed-off-by: Dimitar Dimitrov <[email protected]>
* Add CHANGELOG.md entry
Signed-off-by: Dimitar Dimitrov <[email protected]>
* Update CHANGELOG.md
Co-authored-by: Charles Korn <[email protected]>
* Rename clamping function
Signed-off-by: Dimitar Dimitrov <[email protected]>
---------
Signed-off-by: Dimitar Dimitrov <[email protected]>
Co-authored-by: Charles Korn <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,7 @@
100
100
*[BUGFIX] Ruler: map invalid org-id errors to 400 status code. #8935
101
101
*[BUGFIX] Querier: Fix invalid query results when multiple chunks are being merged. #8992
102
102
*[BUGFIX] Query-frontend: return annotations generated during evaluation of sharded queries. #9138
103
+
*[BUGFIX] Querier: Support optional start and end times on `/prometheus/api/v1/labels`, `/prometheus/api/v1/label/<label>/values`, and `/prometheus/api/v1/series` when `max_query_into_future: 0`. #9129
0 commit comments