-
Notifications
You must be signed in to change notification settings - Fork 512
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
query-frontend: inject query cache keys for LabelValues/Cardinality requests #6849
query-frontend: inject query cache keys for LabelValues/Cardinality requests #6849
Conversation
…abelValues Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
GenerateCacheKey(ctx context.Context, userID string, r Request) string | ||
GenerateLabelValuesCacheKey(ctx context.Context, userID, path string, values url.Values) (*GenericQueryCacheKey, error) | ||
GenerateLabelValuesCardinalityCacheKey(ctx context.Context, userID, path string, values url.Values) (*GenericQueryCacheKey, error) |
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 find the Generate
prefix unnecessary and repetitive. I went with it for consistency, but I would rather drop it. If reviewers agree, I can introduce new methods as LabelValuesCacheKey
and LabelValuesCardinalityCacheKey
and open a follow-up PR to rename GenerateCacheKey
to CacheKey
Also: should we still call it CacheSplitter if it generates cache keys, and doesn't actually split anything?
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 find the Generate prefix unnecessary and repetitive
I don't feel strongly about it if you want to change it.
Also: should we still call it CacheSplitter if it generates cache keys, and doesn't actually split anything?
I definitely think this should change.
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
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, thanks!
GenerateCacheKey(ctx context.Context, userID string, r Request) string | ||
GenerateLabelValuesCacheKey(ctx context.Context, userID, path string, values url.Values) (*GenericQueryCacheKey, error) | ||
GenerateLabelValuesCardinalityCacheKey(ctx context.Context, userID, path string, values url.Values) (*GenericQueryCacheKey, error) |
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 find the Generate prefix unnecessary and repetitive
I don't feel strongly about it if you want to change it.
Also: should we still call it CacheSplitter if it generates cache keys, and doesn't actually split anything?
I definitely think this should change.
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
thank you for the review @56quarters. I pushed a few more changes
|
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
This PR makes it possible for GEM to inject its own cache key generation. This required splitting up the existing
genericQueryDelegate
into two interfacesand extending
CacheSplitter
to include LabelValues and Cardinality cache items