Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 7b0ec7e

Browse files
authored
Merge pull request #205 from grafana/ruler-resources
Add the ruler to the read resources dashboard
2 parents c203666 + 7882b98 commit 7b0ec7e

File tree

5 files changed

+69
-3
lines changed

5 files changed

+69
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
## master / unreleased
44

55
* [CHANGE] Add the default preset 'extra_small_user' and reference it in the CLI flags. This will raise the limits of the 'small_user' preset to the defaults for `ingester.max-samples-per-query` and `ingester.max-series-per-query`. #200
6+
* [ENHANCEMENT] Add the Ruler to the read resources dashboard #205
67
* [ENHANCEMENT] Read dashboards now use `cortex_querier_request_duration_seconds` metrics to allow for accurate dashboards when deploying Cortex as a single-binary. #199
7-
* [ENHANCEMENT] Improved Ruler dashboard. Includes information about notifications and per user per rule group evaluation. #197
8+
* [ENHANCEMENT] Improved Ruler dashboard. Includes information about notifications, reads/writes, and per user per rule group evaluation. #197, #205
89
* [FEATURE] Latency recording rules for the metric`cortex_querier_request_duration_seconds` are now part of a `cortex_querier_api` rule group. #199
910
* [FEATURE] Add overrides-exporter as optional deployment to expose configured runtime overrides and presets. #198
1011

cortex-mixin/config.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
ingester: '(ingester|cortex$)',
3030
distributor: '(distributor|cortex$)',
3131
querier: '(querier|cortex$)',
32+
ruler: '(ruler|cortex$)',
3233
query_frontend: '(query-frontend|cortex$)',
3334
table_manager: '(table-manager|cortex$)',
3435
store_gateway: '(store-gateway|cortex$)',

cortex-mixin/dashboards/reads-resources.libsonnet

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ local utils = import 'mixin-utils/utils.libsonnet';
5252
$.goHeapInUsePanel('Memory (go heap inuse)', 'ingester'),
5353
)
5454
)
55+
.addRow(
56+
$.row('Ruler')
57+
.addPanel(
58+
$.panel('Rules') +
59+
$.queryPanel('sum by(instance) (cortex_prometheus_rule_group_rules{%s})' % $.jobMatcher($._config.job_names.ruler), '{{instance}}'),
60+
)
61+
.addPanel(
62+
$.containerCPUUsagePanel('CPU', 'ruler'),
63+
)
64+
)
65+
.addRow(
66+
$.row('')
67+
.addPanel(
68+
$.containerMemoryWorkingSetPanel('Memory (workingset)', 'ruler'),
69+
)
70+
.addPanel(
71+
$.goHeapInUsePanel('Memory (go heap inuse)', 'ruler'),
72+
)
73+
)
5574
.addRowIf(
5675
std.member($._config.storage_engine, 'blocks'),
5776
$.row('Store-gateway')

cortex-mixin/dashboards/ruler.libsonnet

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@ local utils = import 'mixin-utils/utils.libsonnet';
6161
'ruler.json':
6262
$.dashboard('Cortex / Ruler')
6363
.addClusterSelectorTemplates()
64+
.addRow(
65+
($.row('Headlines') + {
66+
height: '100px',
67+
showTitle: false,
68+
})
69+
.addPanel(
70+
$.panel('Active Configurations') +
71+
$.statPanel('sum(cortex_ruler_managers_total{%s})' % $.jobMatcher('ruler'), format='short')
72+
)
73+
.addPanel(
74+
$.panel('Total Rules') +
75+
$.statPanel('sum(cortex_prometheus_rule_group_rules{%s})' % $.jobMatcher('ruler'), format='short')
76+
)
77+
.addPanel(
78+
$.panel('Read from Ingesters - QPS') +
79+
$.statPanel('sum(rate(cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/QueryStream"}[5m]))' % $.jobMatcher('ruler'), format='reqps')
80+
)
81+
.addPanel(
82+
$.panel('Write to Ingesters - QPS') +
83+
$.statPanel('sum(rate(cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/Push"}[5m]))' % $.jobMatcher('ruler'), format='reqps')
84+
)
85+
)
6486
.addRow(
6587
$.row('Rule Evaluations Global')
6688
.addPanel(
@@ -82,7 +104,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
82104
)
83105
)
84106
.addRow(
85-
$.row('Gateway Latency')
107+
$.row('Configuration API (gateway)')
86108
.addPanel(
87109
$.panel('QPS') +
88110
$.qpsPanel('cortex_request_duration_seconds_count{%s, route=~"api_prom_rules.*|api_prom_api_v1_(rules|alerts)"}' % $.jobMatcher($._config.job_names.gateway))
@@ -92,6 +114,28 @@ local utils = import 'mixin-utils/utils.libsonnet';
92114
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.gateway) + [utils.selector.re('route', 'api_prom_rules.*|api_prom_api_v1_(rules|alerts)')])
93115
)
94116
)
117+
.addRow(
118+
$.row('Writes (Ingesters)')
119+
.addPanel(
120+
$.panel('QPS') +
121+
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher('ruler'))
122+
)
123+
.addPanel(
124+
$.panel('Latency') +
125+
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher('ruler'))
126+
)
127+
)
128+
.addRow(
129+
$.row('Reads (Ingesters)')
130+
.addPanel(
131+
$.panel('QPS') +
132+
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher('ruler'))
133+
)
134+
.addPanel(
135+
$.panel('Latency') +
136+
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher('ruler'))
137+
)
138+
)
95139
.addRow(
96140
$.row('Group Evaluations')
97141
.addPanel(

cortex-mixin/dashboards/writes-resources.libsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
4646
.addPanel(
4747
$.goHeapInUsePanel('Memory (go heap inuse)', 'ingester'),
4848
)
49-
) + {
49+
)
50+
+ {
5051
templating+: {
5152
list: [
5253
// Do not allow to include all clusters/namespaces otherwise this dashboard

0 commit comments

Comments
 (0)