]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: don't store exception as e 38334/head
authorKen Dreyer <kdreyer@redhat.com>
Thu, 3 Dec 2020 17:48:06 +0000 (10:48 -0700)
committerBoris Ranto <branto@redhat.com>
Sat, 5 Dec 2020 14:02:27 +0000 (15:02 +0100)
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 <kdreyer@redhat.com>
(cherry picked from commit a17c603effd3367dc64c87a1d6c53d6d3d794fc7)

src/pybind/mgr/prometheus/module.py

index cdce0abb6b7a871d074c617b95ace6286f952a53..a1496a9f69e447cdcc02456eaab1451100fae5ca 100644 (file)
@@ -194,7 +194,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)