Skip to content

Commit cbf13ef

Browse files
committed
Use timeseriesPanel instead of panel when creating panels
Fixes: #44 Depends on: #57 Signed-off-by: Charlie Le <[email protected]>
1 parent 2c32038 commit cbf13ef

14 files changed

+174
-173
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [CHANGE] Enable shuffle sharding in compactors
66
* [CHANGE] Remove chunks support for dashboards
77
* [CHANGE] Update jsonnet-libs to Fri Jul 19 12:51:49 2024 #57
8+
* [CHANGE] Use `timeseriesPanel` instead of `panel` when creating panels #58
89
* [ENHANCEMENT] Configure `-ingester.client.grpc-compression` to be `snappy-block`
910
* [ENHANCEMENT] Support Grafana 11 in Cortex Service Scaling Dashboard
1011

cortex-mixin/dashboards/alertmanager.libsonnet

+21-21
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ local utils = import 'mixin-utils/utils.libsonnet';
1010
showTitle: false,
1111
})
1212
.addPanel(
13-
$.panel('Total Alerts') +
13+
$.timeseriesPanel('Total Alerts') +
1414
$.statPanel('sum(cluster_job_%s:cortex_alertmanager_alerts:sum{%s})' % [$._config.per_instance_label, $.jobMatcher($._config.job_names.alertmanager)], format='short')
1515
)
1616
.addPanel(
17-
$.panel('Total Silences') +
17+
$.timeseriesPanel('Total Silences') +
1818
$.statPanel('sum(cluster_job_%s:cortex_alertmanager_silences:sum{%s})' % [$._config.per_instance_label, $.jobMatcher($._config.job_names.alertmanager)], format='short')
1919
)
2020
.addPanel(
21-
$.panel('Tenants') +
21+
$.timeseriesPanel('Tenants') +
2222
$.statPanel('max(cortex_alertmanager_tenants_discovered{%s})' % $.jobMatcher($._config.job_names.alertmanager), format='short')
2323
)
2424
)
2525
.addRow(
2626
$.row('Alerts Received')
2727
.addPanel(
28-
$.panel('APS') +
28+
$.timeseriesPanel('APS') +
2929
$.queryPanel(
3030
[
3131
|||
@@ -42,7 +42,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
4242
.addRow(
4343
$.row('Alert Notifications')
4444
.addPanel(
45-
$.panel('NPS') +
45+
$.timeseriesPanel('NPS') +
4646
$.queryPanel(
4747
[
4848
|||
@@ -56,7 +56,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
5656
)
5757
)
5858
.addPanel(
59-
$.panel('NPS by integration') +
59+
$.timeseriesPanel('NPS by integration') +
6060
$.queryPanel(
6161
[
6262
|||
@@ -73,18 +73,18 @@ local utils = import 'mixin-utils/utils.libsonnet';
7373
)
7474
)
7575
.addPanel(
76-
$.panel('Latency') +
76+
$.timeseriesPanel('Latency') +
7777
$.latencyPanel('cortex_alertmanager_notification_latency_seconds', '{%s}' % $.jobMatcher($._config.job_names.alertmanager))
7878
)
7979
)
8080
.addRow(
8181
$.row('Configuration API (gateway) + Alertmanager UI')
8282
.addPanel(
83-
$.panel('QPS') +
83+
$.timeseriesPanel('QPS') +
8484
$.qpsPanel('cortex_request_duration_seconds_count{%s, route=~"api_v1_alerts|alertmanager"}' % $.jobMatcher($._config.job_names.gateway))
8585
)
8686
.addPanel(
87-
$.panel('Latency') +
87+
$.timeseriesPanel('Latency') +
8888
utils.latencyRecordingRulePanel('cortex_request_duration_seconds', $.jobSelector($._config.job_names.gateway) + [utils.selector.re('route', 'api_v1_alerts|alertmanager')])
8989
)
9090
)
@@ -94,23 +94,23 @@ local utils = import 'mixin-utils/utils.libsonnet';
9494
.addRow(
9595
$.row('Replication')
9696
.addPanel(
97-
$.panel('Per %s Tenants' % $._config.per_instance_label) +
97+
$.timeseriesPanel('Per %s Tenants' % $._config.per_instance_label) +
9898
$.queryPanel(
9999
'max by(%s) (cortex_alertmanager_tenants_owned{%s})' % [$._config.per_instance_label, $.jobMatcher($._config.job_names.alertmanager)],
100100
'{{%s}}' % $._config.per_instance_label
101101
) +
102102
$.stack
103103
)
104104
.addPanel(
105-
$.panel('Per %s Alerts' % $._config.per_instance_label) +
105+
$.timeseriesPanel('Per %s Alerts' % $._config.per_instance_label) +
106106
$.queryPanel(
107107
'sum by(%s) (cluster_job_%s:cortex_alertmanager_alerts:sum{%s})' % [$._config.per_instance_label, $._config.per_instance_label, $.jobMatcher($._config.job_names.alertmanager)],
108108
'{{%s}}' % $._config.per_instance_label
109109
) +
110110
$.stack
111111
)
112112
.addPanel(
113-
$.panel('Per %s Silences' % $._config.per_instance_label) +
113+
$.timeseriesPanel('Per %s Silences' % $._config.per_instance_label) +
114114
$.queryPanel(
115115
'sum by(%s) (cluster_job_%s:cortex_alertmanager_silences:sum{%s})' % [$._config.per_instance_label, $._config.per_instance_label, $.jobMatcher($._config.job_names.alertmanager)],
116116
'{{%s}}' % $._config.per_instance_label
@@ -121,7 +121,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
121121
.addRow(
122122
$.row('Tenant Configuration Sync')
123123
.addPanel(
124-
$.panel('Syncs/sec') +
124+
$.timeseriesPanel('Syncs/sec') +
125125
$.queryPanel(
126126
[
127127
|||
@@ -135,14 +135,14 @@ local utils = import 'mixin-utils/utils.libsonnet';
135135
)
136136
)
137137
.addPanel(
138-
$.panel('Syncs/sec (By Reason)') +
138+
$.timeseriesPanel('Syncs/sec (By Reason)') +
139139
$.queryPanel(
140140
'sum by(reason) (rate(cortex_alertmanager_sync_configs_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.alertmanager),
141141
'{{reason}}'
142142
)
143143
)
144144
.addPanel(
145-
$.panel('Ring Check Errors/sec') +
145+
$.timeseriesPanel('Ring Check Errors/sec') +
146146
$.queryPanel(
147147
'sum (rate(cortex_alertmanager_ring_check_errors_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.alertmanager),
148148
'errors'
@@ -152,7 +152,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
152152
.addRow(
153153
$.row('Sharding Initial State Sync')
154154
.addPanel(
155-
$.panel('Initial syncs /sec') +
155+
$.timeseriesPanel('Initial syncs /sec') +
156156
$.queryPanel(
157157
'sum by(outcome) (rate(cortex_alertmanager_state_initial_sync_completed_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.alertmanager),
158158
'{{outcome}}'
@@ -166,7 +166,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
166166
}
167167
)
168168
.addPanel(
169-
$.panel('Initial sync duration') +
169+
$.timeseriesPanel('Initial sync duration') +
170170
$.latencyPanel('cortex_alertmanager_state_initial_sync_duration_seconds', '{%s}' % $.jobMatcher($._config.job_names.alertmanager)) + {
171171
targets: [
172172
target {
@@ -177,7 +177,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
177177
}
178178
)
179179
.addPanel(
180-
$.panel('Fetch state from other alertmanagers /sec') +
180+
$.timeseriesPanel('Fetch state from other alertmanagers /sec') +
181181
$.queryPanel(
182182
[
183183
|||
@@ -201,7 +201,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
201201
.addRow(
202202
$.row('Sharding Runtime State Sync')
203203
.addPanel(
204-
$.panel('Replicate state to other alertmanagers /sec') +
204+
$.timeseriesPanel('Replicate state to other alertmanagers /sec') +
205205
$.queryPanel(
206206
[
207207
|||
@@ -215,7 +215,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
215215
)
216216
)
217217
.addPanel(
218-
$.panel('Merge state from other alertmanagers /sec') +
218+
$.timeseriesPanel('Merge state from other alertmanagers /sec') +
219219
$.queryPanel(
220220
[
221221
|||
@@ -229,7 +229,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
229229
)
230230
)
231231
.addPanel(
232-
$.panel('Persist state to remote storage /sec') +
232+
$.timeseriesPanel('Persist state to remote storage /sec') +
233233
$.queryPanel(
234234
[
235235
|||

cortex-mixin/dashboards/compactor.libsonnet

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
2323
),
2424
)
2525
.addPanel(
26-
$.panel('Tenants compaction progress') +
26+
$.timeseriesPanel('Tenants compaction progress') +
2727
$.queryPanel(|||
2828
(
2929
cortex_compactor_tenants_processing_succeeded{%s} +
@@ -44,7 +44,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
4444
.addRow(
4545
$.row('')
4646
.addPanel(
47-
$.panel('Compacted blocks / sec') +
47+
$.timeseriesPanel('Compacted blocks / sec') +
4848
$.queryPanel('sum(rate(prometheus_tsdb_compactions_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor), 'blocks') +
4949
{ yaxes: $.yaxes('ops') } +
5050
$.panelDescription(
@@ -55,7 +55,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
5555
),
5656
)
5757
.addPanel(
58-
$.panel('Per-block compaction duration') +
58+
$.timeseriesPanel('Per-block compaction duration') +
5959
$.latencyPanel('prometheus_tsdb_compaction_duration_seconds', '{%s}' % $.jobMatcher($._config.job_names.compactor)) +
6060
$.panelDescription(
6161
'Per-block compaction duration',
@@ -68,11 +68,11 @@ local utils = import 'mixin-utils/utils.libsonnet';
6868
.addRow(
6969
$.row('')
7070
.addPanel(
71-
$.panel('Average blocks / tenant') +
71+
$.timeseriesPanel('Average blocks / tenant') +
7272
$.queryPanel('avg(max by(user) (cortex_bucket_blocks_count{%s}))' % $.jobMatcher($._config.job_names.compactor), 'avg'),
7373
)
7474
.addPanel(
75-
$.panel('Tenants with largest number of blocks') +
75+
$.timeseriesPanel('Tenants with largest number of blocks') +
7676
$.queryPanel('topk(10, max by(user) (cortex_bucket_blocks_count{%s}))' % $.jobMatcher($._config.job_names.compactor), '{{user}}') +
7777
$.panelDescription(
7878
'Tenants with largest number of blocks',
@@ -85,7 +85,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
8585
.addRow(
8686
$.row('Garbage Collector')
8787
.addPanel(
88-
$.panel('Blocks marked for deletion / sec') +
88+
$.timeseriesPanel('Blocks marked for deletion / sec') +
8989
$.queryPanel('sum(rate(cortex_compactor_blocks_marked_for_deletion_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor), 'blocks') +
9090
{ yaxes: $.yaxes('ops') },
9191
)
@@ -111,7 +111,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
111111
) + { yaxes: $.yaxes('ops') }
112112
)
113113
.addPanel(
114-
$.panel('Metadata Sync Duration') +
114+
$.timeseriesPanel('Metadata Sync Duration') +
115115
// This metric tracks the duration of a per-tenant metadata sync.
116116
$.latencyPanel('cortex_compactor_meta_sync_duration_seconds', '{%s}' % $.jobMatcher($._config.job_names.compactor)),
117117
)

cortex-mixin/dashboards/config.libsonnet

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
88
.addRow(
99
$.row('Startup config file')
1010
.addPanel(
11-
$.panel('Startup config file hashes') +
11+
$.timeseriesPanel('Startup config file hashes') +
1212
$.queryPanel('count(cortex_config_hash{%s}) by (sha256)' % $.namespaceMatcher(), 'sha256:{{sha256}}') +
1313
$.stack +
1414
{ yaxes: $.yaxes('instances') },
@@ -17,7 +17,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
1717
.addRow(
1818
$.row('Runtime config file')
1919
.addPanel(
20-
$.panel('Runtime config file hashes') +
20+
$.timeseriesPanel('Runtime config file hashes') +
2121
$.queryPanel('count(cortex_runtime_config_hash{%s}) by (sha256)' % $.namespaceMatcher(), 'sha256:{{sha256}}') +
2222
$.stack +
2323
{ yaxes: $.yaxes('instances') },

0 commit comments

Comments
 (0)