From: John Spray Date: Sat, 23 Sep 2017 14:22:34 +0000 (+0100) Subject: mgr/zabbix: log exceptions with backtrace X-Git-Tag: v12.2.2~25^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8cacd2a568fca023a51f3be6e20f90b4ec08c82b;p=ceph.git mgr/zabbix: log exceptions with backtrace Logging just the exception object gave a sometimes-enigmatic single line. Let's use the logger exception method so that we get a backtrace. Signed-off-by: John Spray (cherry picked from commit 316dcc8f0b42b85503632d5472c45c9828882f2c) --- diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index a7baac1ba69..c2125a942ee 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -260,11 +260,12 @@ class Module(MgrModule): while self.run: self.log.debug('Waking up for new iteration') - # Sometimes fetching data fails, should be fixed by PR #16020 try: self.send() except Exception as exc: - self.log.error(exc) + # Shouldn't happen, but let's log it and retry next interval, + # rather than dying completely. + self.log.exception("Unexpected error during send():") interval = self.config['interval'] self.log.debug('Sleeping for %d seconds', interval)