]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: fix perf channel to screen out non-default pool applications
authorLaura Flores <lflores@redhat.com>
Wed, 2 Feb 2022 23:08:11 +0000 (23:08 +0000)
committerLaura Flores <lflores@redhat.com>
Mon, 14 Feb 2022 18:51:35 +0000 (18:51 +0000)
Signed-off-by: Laura Flores <lflores@redhat.com>
(cherry picked from commit 7467ed59aceb696e6682081dd03bbe8e9cccf789)

src/pybind/mgr/telemetry/module.py

index 9dd53f8dc9bba5d1a82436a40da13ec38fc87b06..66794b00f32e27bc5580a38375e8881a58db3731 100644 (file)
@@ -598,19 +598,15 @@ class Module(MgrModule):
 
         # collect application metadata from osd_map
         osd_map = self.get('osd_map')
-        app_dict = {}
-        for pool in osd_map['pools']:
-            app_dict[pool['pool']] = pool['application_metadata']
+        application_metadata = {pool['pool']: pool['application_metadata'] for pool in osd_map['pools']}
 
         # add application to each pool from pg_dump
         for pool in result:
-            poolid = pool['poolid']
-            # Check that the pool has an application. If it does not,
-            # the application dict will be empty.
-            if app_dict[poolid]:
-                pool['application'] = list(app_dict[poolid].keys())[0]
-            else:
-                pool['application'] = ""
+            pool['application'] = []
+            # Only include default applications
+            for application in application_metadata[pool['poolid']]:
+                if application in ['cephfs', 'mgr', 'rbd', 'rgw']:
+                    pool['application'].append(application)
 
         return result