Skip to content

Commit b9d0544

Browse files
authored
Merge pull request grafana#409 from aallawala/aja_ruler_selector
use ruler jobname for ruler dashboard panels
2 parents 5a6b0e8 + e037725 commit b9d0544

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
* [ENHANCEMENT] Add recording rules to improve responsiveness of Alertmanager dashboard. #387
6868
* [ENHANCEMENT] Add `CortexRolloutStuck` alert. #405
6969
* [ENHANCEMENT] Added `CortexKVStoreFailure` alert. #406
70+
* [ENHANCEMENT] Use configured `ruler` jobname for ruler dashboard panels. #409
7071
* [ENHANCEMENT] Add ability to override `datasource` for generated dashboards. #407
7172
* [BUGFIX] Fixed `CortexIngesterHasNotShippedBlocks` alert false positive in case an ingester instance had ingested samples in the past, then no traffic was received for a long period and then it started receiving samples again. #308
7273
* [BUGFIX] Alertmanager: fixed `--alertmanager.cluster.peers` CLI flag passed to alertmanager when HA is enabled. #329

cortex-mixin/dashboards/ruler.libsonnet

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ local utils = import 'mixin-utils/utils.libsonnet';
6868
})
6969
.addPanel(
7070
$.panel('Active Configurations') +
71-
$.statPanel('sum(cortex_ruler_managers_total{%s})' % $.jobMatcher('ruler'), format='short')
71+
$.statPanel('sum(cortex_ruler_managers_total{%s})' % $.jobMatcher($._config.job_names.ruler), format='short')
7272
)
7373
.addPanel(
7474
$.panel('Total Rules') +
75-
$.statPanel('sum(cortex_prometheus_rule_group_rules{%s})' % $.jobMatcher('ruler'), format='short')
75+
$.statPanel('sum(cortex_prometheus_rule_group_rules{%s})' % $.jobMatcher($._config.job_names.ruler), format='short')
7676
)
7777
.addPanel(
7878
$.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')
79+
$.statPanel('sum(rate(cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/QueryStream"}[5m]))' % $.jobMatcher($._config.job_names.ruler), format='reqps')
8080
)
8181
.addPanel(
8282
$.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')
83+
$.statPanel('sum(rate(cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/Push"}[5m]))' % $.jobMatcher($._config.job_names.ruler), format='reqps')
8484
)
8585
)
8686
.addRow(
@@ -89,16 +89,16 @@ local utils = import 'mixin-utils/utils.libsonnet';
8989
$.panel('EPS') +
9090
$.queryPanel(
9191
[
92-
$.rulerQueries.ruleEvaluations.success % [$.jobMatcher('ruler'), $.jobMatcher('ruler')],
93-
$.rulerQueries.ruleEvaluations.failure % $.jobMatcher('ruler'),
92+
$.rulerQueries.ruleEvaluations.success % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)],
93+
$.rulerQueries.ruleEvaluations.failure % $.jobMatcher($._config.job_names.ruler),
9494
],
9595
['success', 'failed'],
9696
),
9797
)
9898
.addPanel(
9999
$.panel('Latency') +
100100
$.queryPanel(
101-
$.rulerQueries.ruleEvaluations.latency % [$.jobMatcher('ruler'), $.jobMatcher('ruler')],
101+
$.rulerQueries.ruleEvaluations.latency % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)],
102102
'average'
103103
),
104104
)
@@ -126,22 +126,22 @@ local utils = import 'mixin-utils/utils.libsonnet';
126126
$.row('Writes (Ingesters)')
127127
.addPanel(
128128
$.panel('QPS') +
129-
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher('ruler'))
129+
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher($._config.job_names.ruler))
130130
)
131131
.addPanel(
132132
$.panel('Latency') +
133-
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher('ruler'))
133+
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/Push"}' % $.jobMatcher($._config.job_names.ruler))
134134
)
135135
)
136136
.addRow(
137137
$.row('Reads (Ingesters)')
138138
.addPanel(
139139
$.panel('QPS') +
140-
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher('ruler'))
140+
$.qpsPanel('cortex_ingester_client_request_duration_seconds_count{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher($._config.job_names.ruler))
141141
)
142142
.addPanel(
143143
$.panel('Latency') +
144-
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher('ruler'))
144+
$.latencyPanel('cortex_ingester_client_request_duration_seconds', '{%s, operation="/cortex.Ingester/QueryStream"}' % $.jobMatcher($._config.job_names.ruler))
145145
)
146146
)
147147
.addRowIf(
@@ -208,34 +208,34 @@ local utils = import 'mixin-utils/utils.libsonnet';
208208
$.row('Notifications')
209209
.addPanel(
210210
$.panel('Delivery Errors') +
211-
$.queryPanel($.rulerQueries.notifications.failure % [$.jobMatcher('ruler'), $.jobMatcher('ruler')], '{{ user }}')
211+
$.queryPanel($.rulerQueries.notifications.failure % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)], '{{ user }}')
212212
)
213213
.addPanel(
214214
$.panel('Queue Length') +
215-
$.queryPanel($.rulerQueries.notifications.queue % [$.jobMatcher('ruler'), $.jobMatcher('ruler')], '{{ user }}')
215+
$.queryPanel($.rulerQueries.notifications.queue % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)], '{{ user }}')
216216
)
217217
.addPanel(
218218
$.panel('Dropped') +
219-
$.queryPanel($.rulerQueries.notifications.dropped % $.jobMatcher('ruler'), '{{ user }}')
219+
$.queryPanel($.rulerQueries.notifications.dropped % $.jobMatcher($._config.job_names.ruler), '{{ user }}')
220220
)
221221
)
222222
.addRow(
223223
($.row('Group Evaluations') + { collapse: true })
224224
.addPanel(
225225
$.panel('Missed Iterations') +
226-
$.queryPanel($.rulerQueries.groupEvaluations.missedIterations % $.jobMatcher('ruler'), '{{ user }}'),
226+
$.queryPanel($.rulerQueries.groupEvaluations.missedIterations % $.jobMatcher($._config.job_names.ruler), '{{ user }}'),
227227
)
228228
.addPanel(
229229
$.panel('Latency') +
230230
$.queryPanel(
231-
$.rulerQueries.groupEvaluations.latency % [$.jobMatcher('ruler'), $.jobMatcher('ruler')],
231+
$.rulerQueries.groupEvaluations.latency % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)],
232232
'{{ user }}'
233233
),
234234
)
235235
.addPanel(
236236
$.panel('Failures') +
237237
$.queryPanel(
238-
$.rulerQueries.perUserPerGroupEvaluations.failure % [$.jobMatcher('ruler')], '{{ rule_group }}'
238+
$.rulerQueries.perUserPerGroupEvaluations.failure % [$.jobMatcher($._config.job_names.ruler)], '{{ rule_group }}'
239239
)
240240
)
241241
)
@@ -244,7 +244,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
244244
.addPanel(
245245
$.panel('Latency') +
246246
$.queryPanel(
247-
$.rulerQueries.perUserPerGroupEvaluations.latency % [$.jobMatcher('ruler'), $.jobMatcher('ruler')],
247+
$.rulerQueries.perUserPerGroupEvaluations.latency % [$.jobMatcher($._config.job_names.ruler), $.jobMatcher($._config.job_names.ruler)],
248248
'{{ user }}'
249249
)
250250
)

0 commit comments

Comments
 (0)