-
Notifications
You must be signed in to change notification settings - Fork 816
Ingester: Metadata APIs should honour QueryIngestersWithin when QueryStoreForLabels is enabled #5027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
30e447a
to
829e403
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the changelog changes. Thanks for the awesome work!
829e403
to
43db2a7
Compare
5d1ab32
to
1737e53
Compare
pkg/querier/distributor_queryable.go
Outdated
// older time ranges (while in Cortex we do ignore the start/end and always return | ||
// series in ingesters). | ||
// Also, in the recent versions of Prometheus, we pass in the hint but with Func set to "series". | ||
if q.queryIngestersWithin > 0 && !(sp != nil && sp.Func == "series" && !q.queryStoreForLabels) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Is this condition too hard to read?
Maybe we could do something like:
// We should query store if `queryStoreForLabels` it set OR we need the chunks
shouldQueryStore := q.queryStoreForLabels || (sp != nil && sp.Func != "series")
if shouldQueryStore && queryIngestersWithin {
// Do the time manipulation
}
Should we enable query store by default? We may even consider deprecate this flag (and enable always) so we stop doing all these |
@alanprot - I can mark the flag as deprecated. Until we remove this flag, we need to do this checks in both ingesters and queriers so that the default behaviour (of querying all the blocks on ingesters) remains the same. Lmk, if I should deprecate this flag in this PR. |
1737e53
to
745b808
Compare
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
d5e77d8
to
2a3d07a
Compare
…StoreForLabels is enabled (cortexproject#5027) * Ingester Metadata APIs should honour QueryIngestersWithin Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]> * Deprecate query-store-for-labels-enabled flag Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]> Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]> Signed-off-by: Alex Le <[email protected]>
What this PR does:
Before adding the feature to query
Ingesters will keep the blocks on disk for up-to:
-blocks-storage.tsdb.retention-period
. This can be a lot more than theQueryIngestersWithin
duration. The query path is already optimized to only query the blocks falling withinnow() - QueryIngestersWithin
from ingesters. This PR adds the optimization also for the metadata APIs.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]