Skip to content

Commit f9a04bc

Browse files
dashboard: fix cluster overview for Grafana 11
grafonnet doesn't fill up empty thresholds for hidden fields. After table code rework introduced in Grafana 11, empty thresholds result in panel crush. Thanks to @0x501D for exploring the issue. Closes #234
1 parent 1a89502 commit f9a04bc

File tree

7 files changed

+75
-11
lines changed

7 files changed

+75
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Fixed
10+
- Prometheus cluster overview panel not works for Grafana 11+ (#234)
11+
12+
713
## [3.1.0] - 2024-07-09
814
Grafana revisions:
915
- Tarantool 3:

dashboard/panels/cluster.libsonnet

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,31 @@ local prometheus = grafana.prometheus;
6464
type: 'number',
6565
unit: 's',
6666
},
67+
{
68+
alias: 'job',
69+
pattern: 'job',
70+
thresholds: [],
71+
type: 'hidden',
72+
},
73+
{
74+
alias: 'Time',
75+
pattern: 'Time',
76+
thresholds: [],
77+
type: 'hidden',
78+
},
79+
{
80+
alias: '__name__',
81+
pattern: '__name__',
82+
thresholds: [],
83+
type: 'hidden',
84+
},
6785
],
6886
sort={
6987
col: 2,
7088
desc: false,
7189
},
7290
transform='table',
73-
).hideColumn('job').hideColumn('/.*/').addTarget(
91+
).addTarget(
7492
if cfg.type == variable.datasource_type.prometheus then
7593
prometheus.target(
7694
expr=if std.objectHas(cfg.filters, 'job') then

tests/Prometheus/dashboard_cartridge_compiled.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,19 @@
118118
{
119119
"alias": "job",
120120
"pattern": "job",
121+
"thresholds": [ ],
122+
"type": "hidden"
123+
},
124+
{
125+
"alias": "Time",
126+
"pattern": "Time",
127+
"thresholds": [ ],
121128
"type": "hidden"
122129
},
123130
{
124-
"alias": "/.*/",
125-
"pattern": "/.*/",
131+
"alias": "__name__",
132+
"pattern": "__name__",
133+
"thresholds": [ ],
126134
"type": "hidden"
127135
}
128136
],

tests/Prometheus/dashboard_custom_compiled.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,19 @@
118118
{
119119
"alias": "job",
120120
"pattern": "job",
121+
"thresholds": [ ],
122+
"type": "hidden"
123+
},
124+
{
125+
"alias": "Time",
126+
"pattern": "Time",
127+
"thresholds": [ ],
121128
"type": "hidden"
122129
},
123130
{
124-
"alias": "/.*/",
125-
"pattern": "/.*/",
131+
"alias": "__name__",
132+
"pattern": "__name__",
133+
"thresholds": [ ],
126134
"type": "hidden"
127135
}
128136
],

tests/Prometheus/dashboard_tarantool3_compiled.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,19 @@
118118
{
119119
"alias": "job",
120120
"pattern": "job",
121+
"thresholds": [ ],
122+
"type": "hidden"
123+
},
124+
{
125+
"alias": "Time",
126+
"pattern": "Time",
127+
"thresholds": [ ],
121128
"type": "hidden"
122129
},
123130
{
124-
"alias": "/.*/",
125-
"pattern": "/.*/",
131+
"alias": "__name__",
132+
"pattern": "__name__",
133+
"thresholds": [ ],
126134
"type": "hidden"
127135
}
128136
],

tests/Prometheus/dashboard_tdg_compiled.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,19 @@
118118
{
119119
"alias": "job",
120120
"pattern": "job",
121+
"thresholds": [ ],
122+
"type": "hidden"
123+
},
124+
{
125+
"alias": "Time",
126+
"pattern": "Time",
127+
"thresholds": [ ],
121128
"type": "hidden"
122129
},
123130
{
124-
"alias": "/.*/",
125-
"pattern": "/.*/",
131+
"alias": "__name__",
132+
"pattern": "__name__",
133+
"thresholds": [ ],
126134
"type": "hidden"
127135
}
128136
],

tests/Prometheus/dashboard_with_custom_panels_compiled.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,19 @@
118118
{
119119
"alias": "job",
120120
"pattern": "job",
121+
"thresholds": [ ],
122+
"type": "hidden"
123+
},
124+
{
125+
"alias": "Time",
126+
"pattern": "Time",
127+
"thresholds": [ ],
121128
"type": "hidden"
122129
},
123130
{
124-
"alias": "/.*/",
125-
"pattern": "/.*/",
131+
"alias": "__name__",
132+
"pattern": "__name__",
133+
"thresholds": [ ],
126134
"type": "hidden"
127135
}
128136
],

0 commit comments

Comments
 (0)