From: alfonsomthd Date: Tue, 23 Apr 2019 14:20:47 +0000 (+0200) Subject: mgr/prometheus: replace whitespaces in metrics' names X-Git-Tag: v12.2.13~64^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae62d61b0aca8ea357e4fce3e7d5f47045573977;p=ceph.git mgr/prometheus: replace whitespaces in metrics' names 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() --- 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