From: Laura Flores Date: Wed, 2 Feb 2022 22:57:38 +0000 (+0000) Subject: mgr/telemetry: create `basic_pool_usage` collection X-Git-Tag: v18.0.0~1386^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f571cd4251422f03f40401c3f9163d716d2b6e4;p=ceph.git mgr/telemetry: create `basic_pool_usage` collection Here, I define the `basic_pool_usage` collection and add pool application under the basic channel. I screen out any applications that are not default. Signed-off-by: Laura Flores --- diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 45baa1a5cc5..133eaa7ac05 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -65,6 +65,7 @@ class Collection(str, enum.Enum): ident_base = 'ident_base' perf_perf = 'perf_perf' basic_mds_metadata = 'basic_mds_metadata' + basic_pool_usage = 'basic_pool_usage' MODULE_COLLECTION : List[Dict] = [ { @@ -102,6 +103,12 @@ MODULE_COLLECTION : List[Dict] = [ "description": "MDS metadata", "channel": "basic", "nag": False + }, + { + "name": Collection.basic_pool_usage, + "description": "Pool application and data usage metrics", + "channel": "basic", + "nag": False } ] @@ -892,8 +899,7 @@ class Module(MgrModule): if k in ['k', 'm', 'plugin', 'technique', 'crush-failure-domain', 'l'] } - cast(List[Dict[str, Any]], report['pools']).append( - { + pool_data = { 'pool': pool['pool'], 'pg_num': pool['pg_num'], 'pgp_num': pool['pg_placement_num'], @@ -906,7 +912,15 @@ class Module(MgrModule): 'erasure_code_profile': ec_profile, 'cache_mode': pool['cache_mode'], } - ) + + # basic_pool_usage collection (1/2) + if self.is_enabled_collection(Collection.basic_pool_usage): + pool_data['application'] = [] + for application in pool['application_metadata']: + # Only include default applications + if application in ['cephfs', 'mgr', 'rbd', 'rgw']: + pool_data['application'].append(application) + cast(List[Dict[str, Any]], report['pools']).append(pool_data) if 'rbd' in pool['application_metadata']: rbd_num_pools += 1 ioctx = self.rados.open_ioctx(pool['pool_name'])