Skip to content

Commit

Permalink
ceph-mixin: fix linting issue and add cluster template support
Browse files Browse the repository at this point in the history
Fix most of the issues reported by dashboards-linter:
- Add matcher/template for job (and also cluster)
- use $__rate_interval everywhere

Also this change all the irate functions to rate as most of irate where
not actually used correctly. While using irate on graph for instance you
can easily miss some of the metrics values as irate only take the two
last values and the query steps can be quite large if you want a graph
for a few hours/a day or more.

Fixes: https://tracker.ceph.com/issues/55003
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>

ceph-mixin: add config with matchers and tags

Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
  • Loading branch information
MrFreezeex committed May 16, 2022
1 parent 1452311 commit faeea8d
Show file tree
Hide file tree
Showing 22 changed files with 1,341 additions and 600 deletions.
9 changes: 8 additions & 1 deletion monitoring/ceph-mixin/config.libsonnet
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{}
{
_config+:: {
dashboardTags: ['ceph-mixin'],

clusterLabel: 'cluster',
showMultiCluster: false,
},
}
17 changes: 12 additions & 5 deletions monitoring/ceph-mixin/dashboards/cephfs.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local g = import 'grafonnet/grafana.libsonnet';
local u = import 'utils.libsonnet';
local c = (import '../mixin.libsonnet')._config;

{
grafanaDashboards+:: {
Expand Down Expand Up @@ -28,7 +29,7 @@ local u = import 'utils.libsonnet';
'now-1h',
'15s',
16,
[],
c.dashboardTags,
'',
{
refresh_intervals: ['5s', '10s', '15s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'],
Expand All @@ -55,10 +56,16 @@ local u = import 'utils.libsonnet';
.addTemplate(
g.template.datasource('datasource', 'prometheus', 'default', label='Data Source')
)
.addTemplate(
u.addClusterTemplate()
)
.addTemplate(
u.addJobTemplate()
)
.addTemplate(
u.addTemplateSchema('mds_servers',
'$datasource',
'label_values(ceph_mds_inodes, ceph_daemon)',
'label_values(ceph_mds_inodes{%(matchers)s}, ceph_daemon)' % u.matchers(),
1,
true,
1,
Expand All @@ -71,15 +78,15 @@ local u = import 'utils.libsonnet';
'MDS Workload - $mds_servers',
'none',
'Reads(-) / Writes (+)',
'sum(rate(ceph_objecter_op_r{ceph_daemon=~"($mds_servers).*"}[1m]))',
'sum(rate(ceph_objecter_op_r{%(matchers)s, ceph_daemon=~"($mds_servers).*"}[$__rate_interval]))' % u.matchers(),
'Read Ops',
0,
1,
12,
9
)
.addTarget(u.addTargetSchema(
'sum(rate(ceph_objecter_op_w{ceph_daemon=~"($mds_servers).*"}[1m]))',
'sum(rate(ceph_objecter_op_w{%(matchers)s, ceph_daemon=~"($mds_servers).*"}[$__rate_interval]))' % u.matchers(),
'Write Ops'
))
.addSeriesOverride(
Expand All @@ -89,7 +96,7 @@ local u = import 'utils.libsonnet';
'Client Request Load - $mds_servers',
'none',
'Client Requests',
'ceph_mds_server_handle_client_request{ceph_daemon=~"($mds_servers).*"}',
'ceph_mds_server_handle_client_request{%(matchers)s, ceph_daemon=~"($mds_servers).*"}' % u.matchers(),
'{{ceph_daemon}}',
12,
1,
Expand Down
1 change: 1 addition & 0 deletions monitoring/ceph-mixin/dashboards/dashboards.libsonnet
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(import '../config.libsonnet') +
(import 'cephfs.libsonnet') +
(import 'host.libsonnet') +
(import 'osd.libsonnet') +
Expand Down
187 changes: 103 additions & 84 deletions monitoring/ceph-mixin/dashboards/host.libsonnet

Large diffs are not rendered by default.

Loading

0 comments on commit faeea8d

Please sign in to comment.