]> git.proxmox.com Git - ceph.git/blob - ceph/monitoring/ceph-mixin/dashboards/rbd.libsonnet
import ceph quincy 17.2.4
[ceph.git] / ceph / monitoring / ceph-mixin / dashboards / rbd.libsonnet
1 local g = import 'grafonnet/grafana.libsonnet';
2 local u = import 'utils.libsonnet';
3
4 (import 'utils.libsonnet') {
5 'rbd-details.json':
6 local RbdDetailsPanel(title, formatY1, expr1, expr2, x, y, w, h) =
7 $.graphPanelSchema({},
8 title,
9 '',
10 'null as zero',
11 false,
12 formatY1,
13 formatY1,
14 null,
15 null,
16 0,
17 1,
18 '$datasource')
19 .addTargets(
20 [
21 $.addTargetSchema(expr1,
22 '{{pool}} Write'),
23 $.addTargetSchema(expr2, '{{pool}} Read'),
24 ]
25 ) + { gridPos: { x: x, y: y, w: w, h: h } };
26
27 $.dashboardSchema(
28 'RBD Details',
29 'Detailed Performance of RBD Images (IOPS/Throughput/Latency)',
30 'YhCYGcuZz',
31 'now-1h',
32 '30s',
33 16,
34 $._config.dashboardTags,
35 ''
36 )
37 .addAnnotation(
38 $.addAnnotationSchema(
39 1,
40 '-- Grafana --',
41 true,
42 true,
43 'rgba(0, 211, 255, 1)',
44 'Annotations & Alerts',
45 'dashboard'
46 )
47 )
48 .addRequired(
49 type='grafana', id='grafana', name='Grafana', version='5.3.3'
50 )
51 .addRequired(
52 type='panel', id='graph', name='Graph', version='5.0.0'
53 )
54 .addTemplate(
55 g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
56 )
57 .addTemplate(
58 $.addClusterTemplate()
59 )
60 .addTemplate(
61 $.addJobTemplate()
62 )
63 .addTemplate(
64 $.addTemplateSchema('pool',
65 '$datasource',
66 'label_values(pool)',
67 1,
68 false,
69 0,
70 '',
71 '')
72 )
73 .addTemplate(
74 $.addTemplateSchema('image',
75 '$datasource',
76 'label_values(image)',
77 1,
78 false,
79 0,
80 '',
81 '')
82 )
83 .addPanels([
84 RbdDetailsPanel(
85 'IOPS',
86 'iops',
87 'rate(ceph_rbd_write_ops{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])' % $.matchers()
88 ,
89 'rate(ceph_rbd_read_ops{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])' % $.matchers(),
90 0,
91 0,
92 8,
93 9
94 ),
95 RbdDetailsPanel(
96 'Throughput',
97 'Bps',
98 'rate(ceph_rbd_write_bytes{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])' % $.matchers(),
99 'rate(ceph_rbd_read_bytes{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])' % $.matchers(),
100 8,
101 0,
102 8,
103 9
104 ),
105 RbdDetailsPanel(
106 'Average Latency',
107 'ns',
108 |||
109 rate(ceph_rbd_write_latency_sum{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval]) /
110 rate(ceph_rbd_write_latency_count{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])
111 ||| % $.matchers(),
112 |||
113 rate(ceph_rbd_read_latency_sum{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval]) /
114 rate(ceph_rbd_read_latency_count{%(matchers)s, pool="$pool", image="$image"}[$__rate_interval])
115 ||| % $.matchers(),
116 16,
117 0,
118 8,
119 9
120 ),
121 ]),
122 'rbd-overview.json':
123 local RbdOverviewPanel(title,
124 formatY1,
125 expr1,
126 expr2,
127 legendFormat1,
128 legendFormat2,
129 x,
130 y,
131 w,
132 h) =
133 $.graphPanelSchema({},
134 title,
135 '',
136 'null',
137 false,
138 formatY1,
139 'short',
140 null,
141 null,
142 0,
143 1,
144 '$datasource')
145 .addTargets(
146 [
147 $.addTargetSchema(expr1,
148 legendFormat1),
149 $.addTargetSchema(expr2,
150 legendFormat2),
151 ]
152 ) + { gridPos: { x: x, y: y, w: w, h: h } };
153
154 $.dashboardSchema(
155 'RBD Overview',
156 '',
157 '41FrpeUiz',
158 'now-1h',
159 '30s',
160 16,
161 $._config.dashboardTags + ['overview'],
162 ''
163 )
164 .addAnnotation(
165 $.addAnnotationSchema(
166 1,
167 '-- Grafana --',
168 true,
169 true,
170 'rgba(0, 211, 255, 1)',
171 'Annotations & Alerts',
172 'dashboard'
173 )
174 )
175 .addRequired(
176 type='grafana', id='grafana', name='Grafana', version='5.4.2'
177 )
178 .addRequired(
179 type='panel', id='graph', name='Graph', version='5.0.0'
180 )
181 .addRequired(
182 type='datasource', id='prometheus', name='Prometheus', version='5.0.0'
183 )
184 .addRequired(
185 type='panel', id='table', name='Table', version='5.0.0'
186 )
187 .addTemplate(
188 g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
189 )
190 .addTemplate(
191 $.addClusterTemplate()
192 )
193 .addTemplate(
194 $.addJobTemplate()
195 )
196 .addPanels([
197 RbdOverviewPanel(
198 'IOPS',
199 'short',
200 'round(sum(rate(ceph_rbd_write_ops{%(matchers)s}[$__rate_interval])))' % $.matchers(),
201 'round(sum(rate(ceph_rbd_read_ops{%(matchers)s}[$__rate_interval])))' % $.matchers(),
202 'Writes',
203 'Reads',
204 0,
205 0,
206 8,
207 7
208 ),
209 RbdOverviewPanel(
210 'Throughput',
211 'Bps',
212 'round(sum(rate(ceph_rbd_write_bytes{%(matchers)s}[$__rate_interval])))' % $.matchers(),
213 'round(sum(rate(ceph_rbd_read_bytes{%(matchers)s}[$__rate_interval])))' % $.matchers(),
214 'Write',
215 'Read',
216 8,
217 0,
218 8,
219 7
220 ),
221 RbdOverviewPanel(
222 'Average Latency',
223 'ns',
224 |||
225 round(
226 sum(rate(ceph_rbd_write_latency_sum{%(matchers)s}[$__rate_interval])) /
227 sum(rate(ceph_rbd_write_latency_count{%(matchers)s}[$__rate_interval]))
228 )
229 ||| % $.matchers(),
230 |||
231 round(
232 sum(rate(ceph_rbd_read_latency_sum{%(matchers)s}[$__rate_interval])) /
233 sum(rate(ceph_rbd_read_latency_count{%(matchers)s}[$__rate_interval]))
234 )
235 ||| % $.matchers(),
236 'Write',
237 'Read',
238 16,
239 0,
240 8,
241 7
242 ),
243 $.addTableSchema(
244 '$datasource',
245 '',
246 { col: 3, desc: true },
247 [
248 $.overviewStyle('Pool', 'pool', 'string', 'short'),
249 $.overviewStyle('Image', 'image', 'string', 'short'),
250 $.overviewStyle('IOPS', 'Value', 'number', 'iops'),
251 $.overviewStyle('', '/.*/', 'hidden', 'short'),
252 ],
253 'Highest IOPS',
254 'table'
255 )
256 .addTarget(
257 $.addTargetSchema(
258 |||
259 topk(10,
260 (
261 sort((
262 rate(ceph_rbd_write_ops{%(matchers)s}[$__rate_interval]) +
263 on (image, pool, namespace) rate(ceph_rbd_read_ops{%(matchers)s}[$__rate_interval])
264 ))
265 )
266 )
267 ||| % $.matchers(),
268 '',
269 'table',
270 1,
271 true
272 )
273 ) + { gridPos: { x: 0, y: 7, w: 8, h: 7 } },
274 $.addTableSchema(
275 '$datasource',
276 '',
277 { col: 3, desc: true },
278 [
279 $.overviewStyle('Pool', 'pool', 'string', 'short'),
280 $.overviewStyle('Image', 'image', 'string', 'short'),
281 $.overviewStyle('Throughput', 'Value', 'number', 'Bps'),
282 $.overviewStyle('', '/.*/', 'hidden', 'short'),
283 ],
284 'Highest Throughput',
285 'table'
286 )
287 .addTarget(
288 $.addTargetSchema(
289 |||
290 topk(10,
291 sort(
292 sum(
293 rate(ceph_rbd_read_bytes{%(matchers)s}[$__rate_interval]) +
294 rate(ceph_rbd_write_bytes{%(matchers)s}[$__rate_interval])
295 ) by (pool, image, namespace)
296 )
297 )
298 ||| % $.matchers(),
299 '',
300 'table',
301 1,
302 true
303 )
304 ) + { gridPos: { x: 8, y: 7, w: 8, h: 7 } },
305 $.addTableSchema(
306 '$datasource',
307 '',
308 { col: 3, desc: true },
309 [
310 $.overviewStyle('Pool', 'pool', 'string', 'short'),
311 $.overviewStyle('Image', 'image', 'string', 'short'),
312 $.overviewStyle('Latency', 'Value', 'number', 'ns'),
313 $.overviewStyle('', '/.*/', 'hidden', 'short'),
314 ],
315 'Highest Latency',
316 'table'
317 )
318 .addTarget(
319 $.addTargetSchema(
320 |||
321 topk(10,
322 sum(
323 rate(ceph_rbd_write_latency_sum{%(matchers)s}[$__rate_interval]) /
324 clamp_min(rate(ceph_rbd_write_latency_count{%(matchers)s}[$__rate_interval]), 1) +
325 rate(ceph_rbd_read_latency_sum{%(matchers)s}[$__rate_interval]) /
326 clamp_min(rate(ceph_rbd_read_latency_count{%(matchers)s}[$__rate_interval]), 1)
327 ) by (pool, image, namespace)
328 )
329 ||| % $.matchers(),
330 '',
331 'table',
332 1,
333 true
334 )
335 ) + { gridPos: { x: 16, y: 7, w: 8, h: 7 } },
336 ]),
337 }