From ae62d61b0aca8ea357e4fce3e7d5f47045573977 Mon Sep 17 00:00:00 2001 From: alfonsomthd Date: Tue, 23 Apr 2019 16:20:47 +0200 Subject: [PATCH] mgr/prometheus: replace whitespaces in metrics' names MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes: https://tracker.ceph.com/issues/39434 Signed-off-by: Alfonso Martínez (cherry picked from commit 843802f43eaa8d0117dd2585b19ac71add3f1024) Conflicts: - path: src/pybind/mgr/prometheus/module.py comment: resolved new line conflict in promethize() --- src/pybind/mgr/prometheus/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 880549526a3..8b11a844eda 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -142,7 +142,8 @@ class Metric(object): def promethize(path): ''' replace illegal metric name characters ''' - result = path.replace('.', '_').replace('+', '_plus').replace('::', '_') + result = path.replace('.', '_').replace( + '+', '_plus').replace('::', '_').replace(' ', '_') # Hyphens usually turn into underscores, unless they are # trailing -- 2.47.3