Project

General

Profile

Actions

Bug #21469

closed

mgr prometheus plugin name sanitisation is buggy

Added by Peter Gervai over 6 years ago. Updated over 6 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

mgr/prometheus/module.py tries to sanitise the names. Unfortunately it doesn't seem to be enough.
The problem is
  • mds_mem.dir+
  • mds_mem.dir-
  • mds_mem.dir

plus is illegal, and convrting all to underscore results duplicate names, hence:

--- module.py.orig      2017-09-20 00:20:57.275582142 +0200
+++ module.py   2017-09-20 00:33:42.978257980 +0200
@@ -76,7 +76,7 @@

         def promethize(path):
             ''' replace illegal metric name characters '''
-            return path.replace('.', '_').replace('-', '_')
+            return path.replace('.', '_').replace('-', '_').replace('+','_P_')

         def floatstr(value):
             ''' represent as Go-compatible float '''

But generally it would be better idea to replace everything which is not allowed in the label.

Actions #1

Updated by Dan Mick over 6 years ago

There's a set of PRs to address/change this in a different way (the existing sanitization was a half-hearted effort at best, indeed).
In fact this is a dup of #20899.

Actions #2

Updated by Dan Mick over 6 years ago

  • Status changed from New to Duplicate
Actions #3

Updated by Dan Mick over 6 years ago

One of the PRs in question (maybe the only one merged, not sure): https://github.com/ceph/ceph/pull/17318

Actions

Also available in: Atom PDF