From 6a65408c1364669916643329494825aae394b200 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 11 Aug 2017 12:05:09 +0200 Subject: [PATCH] pybind/mgr/prometheus: don't get perf counters that are not in schema Signed-off-by: Jan Fajerski (cherry picked from commit d4ba07d04477ccae3a89dcdcafbb7e76149dfd1c) --- src/pybind/mgr/prometheus/module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 9822219ebc8bb..8af538149be76 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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 -- 2.39.5