From: Aashish Sharma Date: Tue, 19 Jul 2022 09:04:18 +0000 (+0530) Subject: mgr/dashboard:Get "Different Storage Class" metrics in Prometheus dashboard X-Git-Tag: v18.0.0~461^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=20705677acd5935981bd8510702b47e1b0678d27;p=ceph.git mgr/dashboard:Get "Different Storage Class" metrics in Prometheus dashboard Get metrics of the different "HDDRule" and "MixedUse" classes of the "Raw Storage" for their ceph VMs. So that Prometheus can scrape the data and display it to them in grafana Fixes: https://tracker.ceph.com/issues/56625 Signed-off-by: Aashish Sharma --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index ad7c32924ef58..56d239843d137 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -794,6 +794,13 @@ class Module(MgrModule): path, 'DF {}'.format(state), ) + path = 'cluster_by_class_{}'.format(state) + metrics[path] = Metric( + 'gauge', + path, + 'DF {}'.format(state), + ('device_class',) + ) for state in DF_POOL: path = 'pool_{}'.format(state) metrics[path] = Metric( @@ -921,6 +928,8 @@ class Module(MgrModule): df = self.get('df') for stat in DF_CLUSTER: self.metrics['cluster_{}'.format(stat)].set(df['stats'][stat]) + for device_class in df['stats_by_class']: + self.metrics['cluster_by_class_{}'.format(stat)].set(df['stats_by_class'][device_class][stat], (device_class,)) for pool in df['pools']: for stat in DF_POOL: