From 836d9bab2783c4fb2e2972f34a8e60b9a911737a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 16 Mar 2021 15:10:42 -0500 Subject: [PATCH] mgr/prometheus: fix typo in get_collect_time_metrics This causes a failure the first time through this function, but subsequent calls succeed, making it a bit hard to notice. Fixes: 58fd057e2c8799fa000b9937aa992e13cbbd485f Fixes: https://tracker.ceph.com/issues/49846 Signed-off-by: Sage Weil (cherry picked from commit c80b944fd4f32dea6a153375d9bdeb4a6e1d0b4c) --- src/pybind/mgr/prometheus/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index ebb353fe2a08c..0446948f86860 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -1132,11 +1132,11 @@ class Module(MgrModule): sum_metric = self.metrics.get('prometheus_collect_duration_seconds_sum') count_metric = self.metrics.get('prometheus_collect_duration_seconds_count') if sum_metric is None: - sum_metrics = MetricCounter( + sum_metric = MetricCounter( 'prometheus_collect_duration_seconds_sum', 'The sum of seconds took to collect all metrics of this exporter', ('method',)) - self.metrics['prometheus_collect_duration_seconds_sum'] = sum_metrics + self.metrics['prometheus_collect_duration_seconds_sum'] = sum_metric if count_metric is None: count_metric = MetricCounter( 'prometheus_collect_duration_seconds_count', -- 2.39.5