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