]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: replace whitespaces in metrics' names 31105/head
authoralfonsomthd <almartin@redhat.com>
Tue, 23 Apr 2019 14:20:47 +0000 (16:20 +0200)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Thu, 24 Oct 2019 03:04:31 +0000 (10:04 +0700)
Fixes: https://tracker.ceph.com/issues/39434
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
(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

index 880549526a32cb2d49fb3b264c9a041497cd7310..8b11a844edaac96045ba3ea51d6e2453bc98e1ab 100644 (file)
@@ -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