]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/prometheus: don't get perf counters that are not in schema
authorJan Fajerski <jfajerski@suse.com>
Fri, 11 Aug 2017 10:05:09 +0000 (12:05 +0200)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:24 +0000 (23:03 +0000)
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit d4ba07d04477ccae3a89dcdcafbb7e76149dfd1c)

src/pybind/mgr/prometheus/module.py

index 9822219ebc8bb630573ea932f7e62f2080a68e43..8af538149be76c1a23061f290709a40c44e9f329 100644 (file)
@@ -333,6 +333,10 @@ class Module(MgrModule):
 
     def get_stat(self, daemon, path):
 
+        if daemon not in self.schema or path not in self.schema[daemon]:
+            self.log.debug('{} for {} not (yet) in schema'.format(path,
+                                                                  daemon))
+            return
         perfcounter = self.schema[daemon][path]
         stattype = stattype_to_str(perfcounter['type'])
         # XXX simplify first effort: no histograms