Skip to content

Commit c044e9b

Browse files
dashboard: use Grafana 11 color scheme in overview table
Before this patch, older Grafana 6 color scheme were used for overview panel. It was fine for Grafana from 8 to 10, but don't work properly with Grafana 11. After this patch, the panel works properly with Grafana 11 and newer. For Grafana 9 and 10 everything works fine, except for row coloring: only single cell is colored [1]. For Grafana 8 and older, table column hiding no longer works properly so it's simpler for us to treat it as unsupported since it's EOLed 1 year and 3 months ago [2]. 1. grafana/grafana#27542 2. https://endoflife.date/grafana Follows #234
1 parent f9a04bc commit c044e9b

17 files changed

+957
-331
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Changed
10+
- Use Grafana 11 color scheme for Prometheus cluster overview panel (#234)
11+
- Drop Grafana 8 support (#234)
12+
- Bump recommended requirements to Grafana 11 (#234)
13+
914
### Fixed
1015
- Prometheus cluster overview panel not works for Grafana 11+ (#234)
1116

dashboard/build/dashboard.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function(cfg) std.foldl(
170170
type='grafana',
171171
id='grafana',
172172
name='Grafana',
173-
version='8.0.0'
173+
version='9.0.0'
174174
).addRequired(
175175
type='panel',
176176
id='graph',

dashboard/panels/cluster.libsonnet

Lines changed: 162 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -27,62 +27,17 @@ local prometheus = grafana.prometheus;
2727
Instance alias filtering is disabled here.
2828
2929
If Prometheus job filter is not specified, displays running instances
30-
and ignores unreachable instances (we have no specific source to fetch)
30+
and ignores unreachable instances (we have no specific source to fetch).
31+
32+
Color scheme is expected to work properly only for Grafana 11+.
3133
|||),
3234
):: tablePanel.new(
3335
title=title,
3436
description=description,
3537
datasource=cfg.datasource,
3638

37-
styles=[
38-
{
39-
alias: 'Instance alias',
40-
pattern: 'alias',
41-
thresholds: [],
42-
type: 'string',
43-
mappingType: 1,
44-
},
45-
{
46-
alias: 'Instance URI',
47-
pattern: 'instance',
48-
thresholds: [],
49-
type: 'string',
50-
mappingType: 1,
51-
},
52-
{
53-
alias: 'Uptime',
54-
colorMode: 'row',
55-
colors: [
56-
'rgba(245, 54, 54, 0.9)',
57-
'rgba(237, 129, 40, 0.89)',
58-
'rgba(50, 172, 45, 0.97)',
59-
],
60-
decimals: 0,
61-
mappingType: 1,
62-
pattern: 'Value',
63-
thresholds: ['0.1', '0.1'],
64-
type: 'number',
65-
unit: 's',
66-
},
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-
},
85-
],
39+
styles=null,
40+
8641
sort={
8742
col: 2,
8843
desc: false,
@@ -114,7 +69,163 @@ local prometheus = grafana.prometheus;
11469
)
11570
else if cfg.type == variable.datasource_type.influxdb then
11671
error 'InfluxDB target is not supported yet'
117-
) { gridPos: { w: 12, h: 8 } },
72+
) {
73+
// Workaround is expected to be removed after migrating to
74+
// https://github.com/tarantool/grafana-dashboard/issues/215
75+
fieldConfig: {
76+
defaults: {
77+
custom: {
78+
cellOptions: {
79+
type: 'auto',
80+
},
81+
inspect: false,
82+
},
83+
mappings: [],
84+
thresholds: {
85+
mode: 'absolute',
86+
steps: [
87+
{
88+
color: 'green',
89+
value: null,
90+
},
91+
{
92+
color: 'red',
93+
value: 80,
94+
},
95+
],
96+
},
97+
},
98+
overrides: [
99+
{
100+
matcher: {
101+
id: 'byName',
102+
options: 'alias',
103+
},
104+
properties: [
105+
{
106+
id: 'displayName',
107+
value: 'Instance alias',
108+
},
109+
{
110+
id: 'custom.align',
111+
},
112+
],
113+
},
114+
{
115+
matcher: {
116+
id: 'byName',
117+
options: 'instance',
118+
},
119+
properties: [
120+
{
121+
id: 'displayName',
122+
value: 'Instance URI',
123+
},
124+
{
125+
id: 'custom.align',
126+
},
127+
],
128+
},
129+
{
130+
matcher: {
131+
id: 'byName',
132+
options: 'Value',
133+
},
134+
properties: [
135+
{
136+
id: 'displayName',
137+
value: 'Uptime',
138+
},
139+
{
140+
id: 'unit',
141+
value: 's',
142+
},
143+
{
144+
id: 'custom.cellOptions',
145+
value: {
146+
applyToRow: true,
147+
type: 'color-background',
148+
},
149+
},
150+
{
151+
id: 'custom.align',
152+
},
153+
{
154+
id: 'thresholds',
155+
value: {
156+
mode: 'absolute',
157+
steps: [
158+
{
159+
color: 'rgba(245, 54, 54, 0.9)',
160+
value: null,
161+
},
162+
{
163+
color: 'rgba(50, 172, 45, 0.97)',
164+
value: 0.1,
165+
},
166+
],
167+
},
168+
},
169+
],
170+
},
171+
{
172+
matcher: {
173+
id: 'byName',
174+
options: 'job',
175+
},
176+
properties: [
177+
{
178+
id: 'displayName',
179+
value: 'job',
180+
},
181+
{
182+
id: 'custom.hidden',
183+
value: true,
184+
},
185+
{
186+
id: 'custom.align',
187+
},
188+
],
189+
},
190+
{
191+
matcher: {
192+
id: 'byName',
193+
options: 'job',
194+
},
195+
properties: [
196+
{
197+
id: 'custom.hidden',
198+
value: true,
199+
},
200+
],
201+
},
202+
{
203+
matcher: {
204+
id: 'byName',
205+
options: 'Time',
206+
},
207+
properties: [
208+
{
209+
id: 'custom.hidden',
210+
value: true,
211+
},
212+
],
213+
},
214+
{
215+
matcher: {
216+
id: 'byName',
217+
options: '__name__',
218+
},
219+
properties: [
220+
{
221+
id: 'custom.hidden',
222+
value: true,
223+
},
224+
],
225+
},
226+
],
227+
},
228+
} { gridPos: { w: 12, h: 8 } },
118229

119230
local title_workaround( // Workaround for missing options.fieldOptions.defaults.title https://github.com/grafana/grafonnet-lib/pull/260
120231
stat_panel,

docker-compose.cartridge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
- ./example_cluster/prometheus/alerts.yml:/etc/prometheus/cartridge_alerts.yml
5959

6060
grafana:
61-
image: grafana/grafana:8.1.3
61+
image: grafana/grafana:11.2.2
6262
environment:
6363
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true"
6464
GF_AUTH_ANONYMOUS_ENABLED: "true"

docker-compose.localapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
- ./example_cluster/prometheus/alerts.yml:/etc/prometheus/alerts.yml
3838

3939
grafana:
40-
image: grafana/grafana:8.1.5
40+
image: grafana/grafana:11.2.2
4141
environment:
4242
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true"
4343
GF_AUTH_ANONYMOUS_ENABLED: "true"

docker-compose.tdg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ services:
6565
- ./example_cluster/prometheus/prometheus.tdg.yml:/etc/prometheus/prometheus.yml
6666

6767
grafana:
68-
image: grafana/grafana:8.1.5
68+
image: grafana/grafana:11.2.2
6969
environment:
7070
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true"
7171
GF_AUTH_ANONYMOUS_ENABLED: "true"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ services:
5858
- ./example_cluster/prometheus/alerts.yml:/etc/prometheus/alerts.yml
5959

6060
grafana:
61-
image: grafana/grafana:8.1.3
61+
image: grafana/grafana:11.2.2
6262
environment:
6363
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true"
6464
GF_AUTH_ANONYMOUS_ENABLED: "true"

tests/InfluxDB/dashboard_cartridge_compiled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "grafana",
66
"name": "Grafana",
77
"type": "grafana",
8-
"version": "8.0.0"
8+
"version": "9.0.0"
99
},
1010
{
1111
"id": "graph",

tests/InfluxDB/dashboard_custom_compiled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "grafana",
66
"name": "Grafana",
77
"type": "grafana",
8-
"version": "8.0.0"
8+
"version": "9.0.0"
99
},
1010
{
1111
"id": "graph",

tests/InfluxDB/dashboard_tarantool3_compiled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "grafana",
66
"name": "Grafana",
77
"type": "grafana",
8-
"version": "8.0.0"
8+
"version": "9.0.0"
99
},
1010
{
1111
"id": "graph",

0 commit comments

Comments
 (0)