Skip to content

Support new cache metrics #11

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

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [CHANGE] Use integrated cortex overrides exporter
* [ENHANCEMENT] Added main.jsonnet examples for azure, gcs and s3
* [ENHANCEMENT] How to rename buckets in AWS and Azure for `not healthy index found` playbook. #5
* [ENHANCEMENT] Support new metrics cortex_cache_fetched_keys_total and cortex_cache_fetched_keys_total
* [BUGFIX] Updated blocks_storage_s3_endpoint in config.libsonnet to include the correct aws region

## 1.11.0 / 2021-12-30
Expand Down
15 changes: 12 additions & 3 deletions cortex-mixin/dashboards/queries.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ local utils = import 'mixin-utils/utils.libsonnet';
)
.addPanel(
$.panel('Results Cache Hit %') +
$.queryPanel('sum(rate(cortex_cache_hits{name=~"frontend.+", %s}[1m])) / sum(rate(cortex_cache_fetched_keys{name=~"frontend.+", %s}[1m]))' % [$.jobMatcher($._config.job_names.query_frontend), $.jobMatcher($._config.job_names.query_frontend)], 'Hit Rate') +
$.queryPanel(|||
sum(rate(cortex_cache_hits{name=~"frontend.+", %(q)s}[1m])) / sum(rate(cortex_cache_fetched_keys{name=~"frontend.+", %(q)s}[1m])) or
sum(rate(cortex_cache_hits_total{name=~"frontend.+", %(q)s}[1m])) / sum(rate(cortex_cache_fetched_keys_total{name=~"frontend.+", %(q)s}[1m]))
||| % { q: $.jobMatcher($._config.job_names.query_frontend) }, 'Hit Rate') +
{ yaxes: $.yaxes({ format: 'percentunit', max: 1 }) },
)
.addPanel(
$.panel('Results Cache misses') +
$.queryPanel('sum(rate(cortex_cache_fetched_keys{name=~"frontend.+", %s}[1m])) - sum(rate(cortex_cache_hits{name=~"frontend.+", %s}[1m]))' % [$.jobMatcher($._config.job_names.query_frontend), $.jobMatcher($._config.job_names.query_frontend)], 'Miss Rate'),
$.queryPanel(|||
sum(rate(cortex_cache_fetched_keys{name=~"frontend.+", %(q)s}[1m])) - sum(rate(cortex_cache_hits{name=~"frontend.+", %(q)s}[1m])) or
sum(rate(cortex_cache_fetched_keys_total{name=~"frontend.+", %(q)s}[1m])) - sum(rate(cortex_cache_hits_total{name=~"frontend.+", %(q)s}[1m]))
||| % { q: $.jobMatcher($._config.job_names.query_frontend) }, 'Miss Rate'),
)
)
.addRow(
Expand Down Expand Up @@ -94,7 +100,10 @@ local utils = import 'mixin-utils/utils.libsonnet';
)
.addPanel(
$.panel('Chunk cache misses') +
$.queryPanel('sum(rate(cortex_cache_fetched_keys{%s,name="chunksmemcache"}[1m])) - sum(rate(cortex_cache_hits{%s,name="chunksmemcache"}[1m]))' % [$.jobMatcher($._config.job_names.querier), $.jobMatcher($._config.job_names.querier)], 'Hit rate'),
$.queryPanel(|||
sum(rate(cortex_cache_fetched_keys{%(q)s,name="chunksmemcache"}[1m])) - sum(rate(cortex_cache_hits{%(q)s,name="chunksmemcache"}[1m])) or
sum(rate(cortex_cache_fetched_keys_total{%(q)s,name="chunksmemcache"}[1m])) - sum(rate(cortex_cache_hits_total{%(q)s,name="chunksmemcache"}[1m]))
||| % { q: $.jobMatcher($._config.job_names.query_frontend) }, 'Hit rate'),
)
.addPanel(
$.panel('Chunk cache corruptions') +
Expand Down