diff --git a/owrx/controllers/metrics.py b/owrx/controllers/metrics.py index 4d41a2a2..2b2614c6 100644 --- a/owrx/controllers/metrics.py +++ b/owrx/controllers/metrics.py @@ -21,7 +21,7 @@ class MetricsController(Controller): else: raise ValueError("Unexpected metric type for metric {}".format(repr(metric))) - return "{key} {value}".format(key=key.replace(".", "_"), value=value) + return "{key} {value}".format(key=re.sub('[^a-zA-Z0-9:_]', '_', key), value=value) data = ["# https://prometheus.io/docs/instrumenting/exposition_formats/"] + [ prometheusFormat(k, v) for k, v in metrics.items()