Skip to content
Snippets Groups Projects
Commit 1cc53221 authored by godog's avatar godog
Browse files
parent 0ceab14d
No related branches found
No related tags found
1 merge request!139base: fix quoting of label values
Pipeline #8080 failed
...@@ -118,7 +118,7 @@ def metric_key(metric, prefix=''): ...@@ -118,7 +118,7 @@ def metric_key(metric, prefix=''):
def metric_format(metric, prefix=''): def metric_format(metric, prefix=''):
key = metric_key(metric, prefix) key = metric_key(metric, prefix)
labels = ','.join( labels = ','.join(
'{k}="{v}"'.format(k=k, v=v) for k, v in metric.labels.items()) '{k}="{v}"'.format(k=k, v=v.replace('"', '\\"')) for k, v in metric.labels.items())
value = decimal.Decimal(metric.value) value = decimal.Decimal(metric.value)
return '{key}{{{labels}}} {value}'.format( return '{key}{{{labels}}} {value}'.format(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment