]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: automatically discover RBD pools for stats gathering 36411/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 16 Jun 2020 14:33:32 +0000 (10:33 -0400)
committerShyukri Shyukriev <shshyukriev@suse.com>
Sun, 2 Aug 2020 15:25:02 +0000 (18:25 +0300)
To simplify configuration, the existing 'rbd_stats_pools' config option
now accepts '*' as a wildcard for the pool and/or namespace portion of
the <pool>[/<namespace>] spec.

Fixes: https://tracker.ceph.com/issues/46034
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 62986a1c3cde4262a76b37529fa865d3c036651d)

Conflicts:
src/pybind/mgr/prometheus/module.py
Do not loose mypy type checks

src/pybind/mgr/prometheus/module.py

index bc0e41ed482dd47a3fbb187c899e326201d66947..1fdf08debab337bd5a8601b5474844aa4a325e75 100644 (file)
@@ -742,7 +742,8 @@ class Module(MgrModule):
 
         # Parse rbd_stats_pools option, which is a comma or space separated
         # list of pool[/namespace] entries. If no namespace is specifed the
-        # stats are collected for every namespace in the pool.
+        # stats are collected for every namespace in the pool. The wildcard
+        # '*' can be used to indicate all pools or namespaces
         pools_string = self.get_localized_module_option('rbd_stats_pools', '')
         pool_keys = []
         for x in re.split('[\s,]+', pools_string):
@@ -773,11 +774,12 @@ class Module(MgrModule):
                 # empty set means collect for all namespaces
                 pools[pool_name] = set()
                 continue
+
             if pool_name not in pools:
                 pools[pool_name] = set()
             elif not pools[pool_name]:
                 continue
-            pools[pool_name].add(s[1])
+            pools[pool_name].add(namespace_name)
 
         rbd_stats_pools = {}
         for pool_id in self.rbd_stats['pools'].keys():