Skip to content

Commit

Permalink
mgr: Ignore daemon if no metadata was returned
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 02569c8)
  • Loading branch information
wido committed Jul 31, 2018
1 parent eaee6d3 commit d85a1ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pybind/mgr/influx/module.py
Expand Up @@ -152,6 +152,9 @@ def get_pg_summary(self, pool_info):
data = []
for osd_id, stats in six.iteritems(osd_sum):
metadata = self.get_metadata('osd', "%s" % osd_id)
if not metadata:
continue

for stat in stats:
point_1 = {
"measurement": "ceph_pg_summary_osd",
Expand Down
2 changes: 2 additions & 0 deletions src/pybind/mgr/telegraf/module.py
Expand Up @@ -110,6 +110,8 @@ def get_daemon_stats(self):
for daemon, counters in six.iteritems(self.get_all_perf_counters()):
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:
Expand Down

0 comments on commit d85a1ea

Please sign in to comment.