diff options
author | John Spray <john.spray@redhat.com> | 2017-09-23 16:22:34 +0200 |
---|---|---|
committer | John Spray <john.spray@redhat.com> | 2017-09-25 11:56:24 +0200 |
commit | 316dcc8f0b42b85503632d5472c45c9828882f2c (patch) | |
tree | a357635ed210709413ace24134328a625db57575 /src/pybind/mgr/zabbix | |
parent | mgr/zabbix: fix div by zero (diff) | |
download | ceph-316dcc8f0b42b85503632d5472c45c9828882f2c.tar.xz ceph-316dcc8f0b42b85503632d5472c45c9828882f2c.zip |
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 <john.spray@redhat.com>
Diffstat (limited to 'src/pybind/mgr/zabbix')
-rw-r--r-- | src/pybind/mgr/zabbix/module.py | 5 |
1 files changed, 3 insertions, 2 deletions
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) |