]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: add df stats to the `basic_pool_usage` collection
authorLaura Flores <lflores@redhat.com>
Wed, 2 Feb 2022 23:02:01 +0000 (23:02 +0000)
committerLaura Flores <lflores@redhat.com>
Mon, 14 Feb 2022 18:51:03 +0000 (18:51 +0000)
The `df` stats under `pools` indicate data usage for each pool.
The `kb_bytes` field is screened out since it is redundant.

Signed-off-by: Laura Flores <lflores@redhat.com>
(cherry picked from commit ee63d624ba395dacd9f9c0ff59a989589448eab8)

src/pybind/mgr/telemetry/module.py

index 133eaa7ac059f4d8cd05d4031836afe962ee113c..74456920a741236c5dccdb14b16f91b8d19b84ab 100644 (file)
@@ -851,6 +851,7 @@ class Module(MgrModule):
             service_map = self.get('service_map')
             fs_map = self.get('fs_map')
             df = self.get('df')
+            df_pools = {pool['id']: pool for pool in df['pools']}
 
             report['created'] = mon_map['created']
 
@@ -920,6 +921,30 @@ class Module(MgrModule):
                         # Only include default applications
                         if application in ['cephfs', 'mgr', 'rbd', 'rgw']:
                             pool_data['application'].append(application)
+                    pool_stats = df_pools[pool['pool']]['stats']
+                    pool_data['stats'] = { # filter out kb_used
+                                            'avail_raw': pool_stats['avail_raw'],
+                                            'bytes_used': pool_stats['bytes_used'],
+                                            'compress_bytes_used': pool_stats['compress_bytes_used'],
+                                            'compress_under_bytes': pool_stats['compress_under_bytes'],
+                                            'data_bytes_used': pool_stats['data_bytes_used'],
+                                            'dirty': pool_stats['dirty'],
+                                            'max_avail': pool_stats['max_avail'],
+                                            'objects': pool_stats['objects'],
+                                            'omap_bytes_used': pool_stats['omap_bytes_used'],
+                                            'percent_used': pool_stats['percent_used'],
+                                            'quota_bytes': pool_stats['quota_bytes'],
+                                            'quota_objects': pool_stats['quota_objects'],
+                                            'rd': pool_stats['rd'],
+                                            'rd_bytes': pool_stats['rd_bytes'],
+                                            'stored': pool_stats['stored'],
+                                            'stored_data': pool_stats['stored_data'],
+                                            'stored_omap': pool_stats['stored_omap'],
+                                            'stored_raw': pool_stats['stored_raw'],
+                                            'wr': pool_stats['wr'],
+                                            'wr_bytes': pool_stats['wr_bytes']
+                        }
+
                 cast(List[Dict[str, Any]], report['pools']).append(pool_data)
                 if 'rbd' in pool['application_metadata']:
                     rbd_num_pools += 1