Both follow prometheus best practices. While : is a legal metric
character, "Exposed metrics should not contain colons, these are for
users to use when aggregating."
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit
177afcc7886aa3898d092ebd1e101697bc6539fd)
def promethize(path):
''' replace illegal metric name characters '''
- result = path.replace('.', '_').replace('+', '_plus')
+ result = path.replace('.', '_').replace('+', '_plus').replace('::', '_')
# Hyphens usually turn into underscores, unless they are
# trailing
else:
result = result.replace("-", "_")
- return result
+ return "ceph_{0}".format(result)
def floatstr(value):
''' represent as Go-compatible float '''