From 895536fb050e2767aa67373357569c8e4994693e Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Tue, 19 Jul 2022 14:34:18 +0530 Subject: [PATCH] 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 (cherry picked from commit 20705677acd5935981bd8510702b47e1b0678d27) --- src/pybind/mgr/prometheus/module.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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: -- 2.39.5