@@ -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,
0 commit comments