From: alfonsomthd Date: Tue, 23 Apr 2019 14:20:47 +0000 (+0200) Subject: mgr/prometheus: replace whitespaces in metrics' names X-Git-Tag: v13.2.7~252^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e13e622ae98167ddaf2373379085fd256c8163fe;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: src/pybind/mgr/prometheus/module.py : Resolved in promethize --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 2d4472434a0..f27b223508b 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