-
Notifications
You must be signed in to change notification settings - Fork 816
Don't query high cardinality labels. #886
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
This will allow us to vary the store implementation over time, and not just the schema. This will unblock the new bigtable storage adapter (using columns instead of rows), and allow us to more easily implement the iterative intersections and indexing of series instead of chunks. Signed-off-by: Tom Wilkie <[email protected]>
…r this schema. I tried to adapt the original chunk store to support this style of indexing - easy on the right path, but the read path became even more of a rats nest. So I factored out the common bits as best I could and made a new chunk store - the seriesStore. Signed-off-by: Tom Wilkie <[email protected]>
Signed-off-by: Tom Wilkie <[email protected]>
Signed-off-by: Tom Wilkie <[email protected]>
Signed-off-by: Tom Wilkie <[email protected]>
Signed-off-by: Tom Wilkie <[email protected]>
After some testing, this improved latency for those particular queries mentioned in #884 by >2x. |
pkg/chunk/chunk_store_test.go
Outdated
var schemas = []struct { | ||
name string | ||
fn func(cfg SchemaConfig) Schema | ||
schemaFn schemaFactory | ||
storeFn storeFactory |
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.
I was expecting this member to come in as part of the refactor to multiple stores.
pkg/chunk/chunk_store_test.go
Outdated
var schemas = []struct { | ||
name string | ||
fn func(cfg SchemaConfig) Schema | ||
requireMetricName bool |
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.
I expected storeFn
to arrive in this commit, even though they would all be the same.
"time" | ||
) | ||
|
||
// heapCache is a simple string -> interface{} cache which uses a heap to manage |
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.
Do we really need to write another cache?
) | ||
|
||
// heapCache is a simple string -> interface{} cache which uses a heap to manage | ||
// evictions. O(log N) inserts, O(n) get and update. |
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.
It looks like it should be O(1) get - is that a typo or am I missing something?
Going to roll this into #875 as I'm struggling to keep track of all my open PRs. |
Fixes #884
This change limits the cardinality for labels; if the limit is exceeded, queries can still work, but there must be another selector with lower cardinality.
Notably, after this change, queries on two high-cardinality labels that would have results in a small number of series will fail.
Builds on seriesStores, so includes #875.