From 02fd614bfc80e0aaf72fcf3932f736d01386e76b Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 3 Dec 2020 10:48:06 -0700 Subject: [PATCH] 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) --- src/pybind/mgr/prometheus/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index f5684f257ef..f3068250fd9 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) -- 2.47.3