Skip to content
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

Improve query results cache hit ratio in the 'Mimir / Queries' dashboard #5423

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Jul 5, 2023

What this PR does

In #5235 I've introduced new fine-grained metrics to measure the query results cache hit ratio. The new metrics allow to get a better measurement because: (a) they only track the cache lookup done by query results cache (e.g. excluding cache usage done by query cardinality estimator) and (b) they're split by request_type.

In this PR I'm improving the Mimir / Queries dashboard to use the new metrics, while keeping backward compatibility:

  1. Use new metric in Query results cache hit ratio, fallback to the old one
  2. Remove Query results cache hit ratio panel because (a) not much useful (b) not even correct, given it includes cache misses from query cardinality estimator

How the new dashboard row looks like:

Screenshot 2023-07-05 at 14 36 04

NOTE: in the dev cluster where I took the screenshot there are no calls to the cardinality API, but I tested the new panel query in production (where we have traffic on cardinality API) and it looks good.

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review July 5, 2023 12:37
@pracucci pracucci requested a review from a team as a code owner July 5, 2023 12:37
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, new query and metrics are much clearer!

@pracucci pracucci merged commit 394d9bb into main Jul 6, 2023
28 checks passed
@pracucci pracucci deleted the improve-query-results-cache-panel branch July 6, 2023 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants