From: Ken Dreyer Date: Thu, 3 Dec 2020 17:48:06 +0000 (-0700) Subject: mgr/prometheus: don't store exception as e X-Git-Tag: v16.1.0~371^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38436%2Fhead;p=ceph.git mgr/prometheus: don't store exception as e Python's logging module's exception() method will log the full exception and stack trace for us, so we do not need to store the exception in the "e" variable here. Signed-off-by: Ken Dreyer --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index bfac1e5ab29d..71d451337d12 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -200,7 +200,7 @@ class MetricCollectionThread(threading.Thread): try: data = self.mod.collect() - except Exception as e: + except: # Log any issues encountered during the data collection and continue self.mod.log.exception("failed to collect metrics:") self.event.wait(self.mod.scrape_interval)