From be7c7891bd52ea0c0e0275748dee8072771570c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 15 Nov 2023 17:35:05 +0100 Subject: [PATCH] stats: fix prometheus label quoting --- src/capport/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/capport/stats.py b/src/capport/stats.py index f0d8a34..8d2692e 100644 --- a/src/capport/stats.py +++ b/src/capport/stats.py @@ -28,8 +28,8 @@ class MetricPrinter: self._now_str = "" labels = [] if self.args.instance: - labels.append(f"instance={self.args.instance!r}") - labels.append(f"interface={self.args.interface!r}") + labels.append(f"instance=\"{self.args.instance}\"") + labels.append(f"interface=\"{self.args.interface}\"") self._label_str = "{" + ",".join(labels) + "}" def print_metric(self, *, name: str, mtype: str, value: typing.Any, help: str | None = None):