Skip to content

Commit b3faa7b

Browse files
Use timeseriesPanel instead of panel when creating panels (#58)
* Update jsonnet-libs to Fri Jul 19 12:51:49 2024 Updates grafana-builder and mixin-utils to latest version in master branch. This will be helpful in creating Grafana panels that use the timeseriesPanel instead of the deprecated panel. grafana-builder changes: - grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285) - More native histograms related utils and renaming (grafana/jsonnet-libs#1270) - Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150) - Basic native histogram utilities (grafana/jsonnet-libs#1164) - grafana-builder: rename template variable "Data Source" to "Data source" (grafana/jsonnet-libs#1111) - Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825) - Allow dashboards to show gRPC codes as labels (grafana/jsonnet-libs#1098) - Allow configuring sort order for variables (grafana/jsonnet-libs#1014) - remove unused/wrong step param (grafana/jsonnet-libs#999) - Show cancelled requests in grey on QPS dashboards. (grafana/jsonnet-libs#988) - Show cancelled requests in yellow on QPS dashboards. (grafana/jsonnet-libs#986) - Add timeseriesPanel (grafana/jsonnet-libs#824) - Allow including "All" for single template var - Allow datasource's regex to be configured - grafana-builder: make allValue configurable (grafana/jsonnet-libs#703) - grafana_builder: add dashboard link func (grafana/jsonnet-libs#683) - Add 'Data Source' label for the default datasource template variable. (grafana/jsonnet-libs#672) - enable toolip by default (grafana/jsonnet-libs#665) mixin-utils changes: - grafana-builder: add support for native/classic stat panel query (grafana/jsonnet-libs#1285) - More native histograms related utils and renaming (grafana/jsonnet-libs#1270) - nativeClassicSumBy: format list of labels nicer (grafana/jsonnet-libs#1204) - Support recording and switching between naive and classic latency histograms (grafana/jsonnet-libs#1150) - chore: fix hardcoded range interval (grafana/jsonnet-libs#1190) - Basic native histogram utilities (grafana/jsonnet-libs#1164) - utils: allow defining native histogram recording rule (grafana/jsonnet-libs#1156) - modify withRunbookURL to allow internal annotation (grafana/jsonnet-libs#1139) - mixin-utils: drop unsupported step target parameter (grafana/jsonnet-libs#1128) - Mixins: draw graphs at full resolution (grafana/jsonnet-libs#825) - Align with style conventions (grafana/jsonnet-libs#1038) - Add a function to remove an alert rule (grafana/jsonnet-libs#812) - mixin-utils: Parameterize interval for histogramRules (grafana/jsonnet-libs#806) - refactor(grafana/jsonnet-libsprometheus): shard mixins over multiple configmaps (grafana/jsonnet-libs#497) - Not all Prometheus rules are alerts. (grafana/jsonnet-libs#490) Signed-off-by: Charlie Le <charlie_le@apple.com> * Use `timeseriesPanel` instead of `panel` when creating panels Fixes: #44 Depends on: #57 Signed-off-by: Charlie Le <charlie_le@apple.com> * Add units to timeseries panel The yaxes field doesn't seem to do anything in the timeseries panel and was replaced with the units field instead. So I defaulted the units to be short and allowed it to be set for the panel. Signed-off-by: Charlie Le <charlie_le@apple.com> * Update CHANGELOG.md --------- Signed-off-by: Charlie Le <charlie_le@apple.com> Co-authored-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
1 parent a630e0e commit b3faa7b

14 files changed

+272
-239
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* [CHANGE] Target 3M memory series per ingester instead of 1.5M
88
* [CHANGE] Update jsonnet-libs to Fri Jul 19 12:51:49 2024 #57
99
* [CHANGE] Increase CortexProvisioningTooManyWrites alert threshold to 160e3
10+
* [CHANGE] Use `timeseriesPanel` instead of `panel` when creating panels #58
1011
* [ENHANCEMENT] Configure `-ingester.client.grpc-compression` to be `snappy-block`
11-
* [ENHANCEMENT] Support Grafana 11 in Cortex Service Scaling Dashboard
12+
* [ENHANCEMENT] Support Grafana 11 in all dashboards
1213
* [BUGFIX] Remove deprecated option `max_series_per_query`
1314

1415
## 1.16.1

cortex-mixin/dashboards/alertmanager.libsonnet

Lines changed: 21 additions & 21 deletions
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', unit='ms') +
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', unit='ms') +
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', unit='s') +
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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
1414
'sum(rate(cortex_compactor_runs_failed_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor)
1515
) +
1616
$.bars +
17-
{ yaxes: $.yaxes('ops') } +
1817
$.panelDescription(
1918
'Per-instance runs',
2019
|||
@@ -23,7 +22,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
2322
),
2423
)
2524
.addPanel(
26-
$.panel('Tenants compaction progress') +
25+
$.timeseriesPanel('Tenants compaction progress') +
2726
$.queryPanel(|||
2827
(
2928
cortex_compactor_tenants_processing_succeeded{%s} +
@@ -44,9 +43,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
4443
.addRow(
4544
$.row('')
4645
.addPanel(
47-
$.panel('Compacted blocks / sec') +
46+
$.timeseriesPanel('Compacted blocks / sec', unit='ops') +
4847
$.queryPanel('sum(rate(prometheus_tsdb_compactions_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor), 'blocks') +
49-
{ yaxes: $.yaxes('ops') } +
5048
$.panelDescription(
5149
'Compacted blocks / sec',
5250
|||
@@ -55,7 +53,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
5553
),
5654
)
5755
.addPanel(
58-
$.panel('Per-block compaction duration') +
56+
$.timeseriesPanel('Per-block compaction duration', unit='s') +
5957
$.latencyPanel('prometheus_tsdb_compaction_duration_seconds', '{%s}' % $.jobMatcher($._config.job_names.compactor)) +
6058
$.panelDescription(
6159
'Per-block compaction duration',
@@ -68,11 +66,11 @@ local utils = import 'mixin-utils/utils.libsonnet';
6866
.addRow(
6967
$.row('')
7068
.addPanel(
71-
$.panel('Average blocks / tenant') +
69+
$.timeseriesPanel('Average blocks / tenant') +
7270
$.queryPanel('avg(max by(user) (cortex_bucket_blocks_count{%s}))' % $.jobMatcher($._config.job_names.compactor), 'avg'),
7371
)
7472
.addPanel(
75-
$.panel('Tenants with largest number of blocks') +
73+
$.timeseriesPanel('Tenants with largest number of blocks') +
7674
$.queryPanel('topk(10, max by(user) (cortex_bucket_blocks_count{%s}))' % $.jobMatcher($._config.job_names.compactor), '{{user}}') +
7775
$.panelDescription(
7876
'Tenants with largest number of blocks',
@@ -85,9 +83,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
8583
.addRow(
8684
$.row('Garbage Collector')
8785
.addPanel(
88-
$.panel('Blocks marked for deletion / sec') +
89-
$.queryPanel('sum(rate(cortex_compactor_blocks_marked_for_deletion_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor), 'blocks') +
90-
{ yaxes: $.yaxes('ops') },
86+
$.timeseriesPanel('Blocks marked for deletion / sec', unit='ops') +
87+
$.queryPanel('sum(rate(cortex_compactor_blocks_marked_for_deletion_total{%s}[$__rate_interval]))' % $.jobMatcher($._config.job_names.compactor), 'blocks'),
9188
)
9289
.addPanel(
9390
$.successFailurePanel(
@@ -111,7 +108,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
111108
) + { yaxes: $.yaxes('ops') }
112109
)
113110
.addPanel(
114-
$.panel('Metadata Sync Duration') +
111+
$.timeseriesPanel('Metadata Sync Duration', unit='ms') +
115112
// This metric tracks the duration of a per-tenant metadata sync.
116113
$.latencyPanel('cortex_compactor_meta_sync_duration_seconds', '{%s}' % $.jobMatcher($._config.job_names.compactor)),
117114
)

cortex-mixin/dashboards/config.libsonnet

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ 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', unit='instances') +
1212
$.queryPanel('count(cortex_config_hash{%s}) by (sha256)' % $.namespaceMatcher(), 'sha256:{{sha256}}') +
13-
$.stack +
14-
{ yaxes: $.yaxes('instances') },
13+
$.stack,
1514
)
1615
)
1716
.addRow(
1817
$.row('Runtime config file')
1918
.addPanel(
20-
$.panel('Runtime config file hashes') +
19+
$.timeseriesPanel('Runtime config file hashes', unit='instances') +
2120
$.queryPanel('count(cortex_runtime_config_hash{%s}) by (sha256)' % $.namespaceMatcher(), 'sha256:{{sha256}}') +
22-
$.stack +
23-
{ yaxes: $.yaxes('instances') },
21+
$.stack,
2422
)
2523
),
2624
}

0 commit comments

Comments
 (0)