1 local g = import 'grafonnet/grafana.libsonnet';
2 local u = import 'utils.libsonnet';
7 local RbdDetailsPanel(title, formatY1, expr1, expr2, x, y, w, h) =
22 u.addTargetSchema(expr1,
26 u.addTargetSchema(expr2, 1, 'time_series', '{{pool}} Read'),
28 ) + { gridPos: { x: x, y: y, w: w, h: h } };
32 'Detailed Performance of RBD Images (IOPS/Throughput/Latency)',
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'],
45 u.addAnnotationSchema(
50 'rgba(0, 211, 255, 1)',
51 'Annotations & Alerts',
56 type='grafana', id='grafana', name='Grafana', version='5.3.3'
59 type='panel', id='graph', name='Graph', version='5.0.0'
62 g.template.datasource('Datasource', 'prometheus', 'default', label=null)
65 u.addTemplateSchema('Pool',
75 u.addTemplateSchema('Image',
77 'label_values(image)',
88 'irate(ceph_rbd_write_ops{pool="$Pool", image="$Image"}[30s])',
89 'irate(ceph_rbd_read_ops{pool="$Pool", image="$Image"}[30s])',
98 'irate(ceph_rbd_write_bytes{pool="$Pool", image="$Image"}[30s])',
99 'irate(ceph_rbd_read_bytes{pool="$Pool", image="$Image"}[30s])',
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])',
117 local RgwOverviewStyle(alias, pattern, type, unit) =
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',
129 local RbdOverviewPanel(title,
139 u.graphPanelSchema({},
153 u.addTargetSchema(expr1,
157 u.addTargetSchema(expr2,
162 ) + { gridPos: { x: x, y: y, w: w, h: h } };
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'],
179 u.addAnnotationSchema(
184 'rgba(0, 211, 255, 1)',
185 'Annotations & Alerts',
190 type='grafana', id='grafana', name='Grafana', version='5.4.2'
193 type='panel', id='graph', name='Graph', version='5.0.0'
196 type='datasource', id='prometheus', name='Prometheus', version='5.0.0'
199 type='panel', id='table', name='Table', version='5.0.0'
202 g.template.datasource('datasource',
211 'round(sum(irate(ceph_rbd_write_ops[30s])))',
212 'round(sum(irate(ceph_rbd_read_ops[30s])))',
223 'round(sum(irate(ceph_rbd_write_bytes[30s])))',
224 'round(sum(irate(ceph_rbd_read_bytes[30s])))',
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])))',
247 { col: 3, desc: true },
249 RgwOverviewStyle('Pool', 'pool', 'string', 'short'),
250 RgwOverviewStyle('Image', 'image', 'string', 'short'),
251 RgwOverviewStyle('IOPS', 'Value', 'number', 'iops'),
252 RgwOverviewStyle('', '/.*/', 'hidden', 'short'),
259 'topk(10, (sort((irate(ceph_rbd_write_ops[30s]) + on (image, pool, namespace) irate(ceph_rbd_read_ops[30s])))))',
264 ) + { gridPos: { x: 0, y: 7, w: 8, h: 7 } },
268 { col: 3, desc: true },
270 RgwOverviewStyle('Pool', 'pool', 'string', 'short'),
271 RgwOverviewStyle('Image', 'image', 'string', 'short'),
272 RgwOverviewStyle('Throughput', 'Value', 'number', 'Bps'),
273 RgwOverviewStyle('', '/.*/', 'hidden', 'short'),
275 'Highest Throughput',
280 'topk(10, sort(sum(irate(ceph_rbd_read_bytes[30s]) + irate(ceph_rbd_write_bytes[30s])) by (pool, image, namespace)))',
285 ) + { gridPos: { x: 8, y: 7, w: 8, h: 7 } },
289 { col: 3, desc: true },
291 RgwOverviewStyle('Pool', 'pool', 'string', 'short'),
292 RgwOverviewStyle('Image', 'image', 'string', 'short'),
293 RgwOverviewStyle('Latency', 'Value', 'number', 'ns'),
294 RgwOverviewStyle('', '/.*/', 'hidden', 'short'),
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)',
306 ) + { gridPos: { x: 16, y: 7, w: 8, h: 7 } },