]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Ignore daemon if no metadata was returned 22794/head
authorWido den Hollander <wido@42on.com>
Mon, 2 Jul 2018 14:36:52 +0000 (16:36 +0200)
committerWido den Hollander <wido@42on.com>
Mon, 2 Jul 2018 14:36:52 +0000 (16:36 +0200)
It can happen that the Mgr does not return any metadata for a given
daemon as it might not be available at that moment.

None is returned by the get_metadata() method at that moment and both
the Influx and Telegraf module should then ignore the daemon in their
statistics and continue on to the next daemon.

Signed-off-by: Wido den Hollander <wido@42on.com>
src/pybind/mgr/influx/module.py
src/pybind/mgr/telegraf/module.py

index 4d111e57af186eda10071df0c9c90ecdf53eaa3e..cf2bf063a5158d08b988c62b24d60599c4fa7556 100644 (file)
@@ -151,6 +151,9 @@ class Module(MgrModule):
         data = []
         for osd_id, stats in osd_sum.iteritems():
             metadata = self.get_metadata('osd', "%s" % osd_id)
+            if not metadata:
+                continue
+
             for stat in stats:
                 point_1 = {
                     "measurement": "ceph_pg_summary_osd",
index 8bda403e98d5e5ee4831593b82a1890445bbbbdd..01166d067abae080fed1ecc75e3c40b34141536d 100644 (file)
@@ -105,6 +105,8 @@ class Module(MgrModule):
         for daemon, counters in self.get_all_perf_counters().iteritems():
             svc_type, svc_id = daemon.split('.', 1)
             metadata = self.get_metadata(svc_type, svc_id)
+            if not metadata:
+                continue
 
             for path, counter_info in counters.items():
                 if counter_info['type'] & self.PERFCOUNTER_HISTOGRAM: