From: alfonsomthd Date: Tue, 23 Apr 2019 14:20:47 +0000 (+0200) Subject: mgr/prometheus: replace whitespaces in metrics' names X-Git-Tag: v14.2.2~205^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9e11cd9812c2ec5b40d587967c6efa5cfafa8bc;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) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index b7fecf8d85a..0f95331f587 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -121,7 +121,7 @@ class Metric(object): def promethize(path): ''' replace illegal metric name characters ''' result = path.replace('.', '_').replace( - '+', '_plus').replace('::', '_') + '+', '_plus').replace('::', '_').replace(' ', '_') # Hyphens usually turn into underscores, unless they are # trailing