From a17c603effd3367dc64c87a1d6c53d6d3d794fc7 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 --- 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 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) -- 2.47.3