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: v15.2.9~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02fd614bfc80e0aaf72fcf3932f736d01386e76b;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 (cherry picked from commit a17c603effd3367dc64c87a1d6c53d6d3d794fc7) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index f5684f257ef5..f3068250fd9f 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -201,7 +201,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)