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 <[email protected]>
  • Loading branch information
wido committed Jul 2, 2018
1 parent 25508d5 commit 02569c8
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
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def get_pg_summary(self, pool_info):
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",
Expand Down
2 changes: 2 additions & 0 deletions src/pybind/mgr/telegraf/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def get_daemon_stats(self):
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:
Expand Down

0 comments on commit 02569c8

Please sign in to comment.