Project

General

Profile

Bug #21469

mgr prometheus plugin name sanitisation is buggy

Added by Peter Gervai almost 2 years ago. Updated almost 2 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
09/19/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

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.

History

#1 Updated by Dan Mick almost 2 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.

#2 Updated by Dan Mick almost 2 years ago

  • Status changed from New to Duplicate

#3 Updated by Dan Mick almost 2 years ago

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

Also available in: Atom PDF