From 4702c6590a24e467cd754f00bd30fdd84b5e3387 Mon Sep 17 00:00:00 2001 From: Jakob van Santen Date: Mon, 6 Feb 2023 10:13:48 +0100 Subject: [PATCH] fixup! fix(deps): prometheus_client 0.16 compat --- ampel/metrics/prometheus.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ampel/metrics/prometheus.py b/ampel/metrics/prometheus.py index 61deb415..25a323fc 100644 --- a/ampel/metrics/prometheus.py +++ b/ampel/metrics/prometheus.py @@ -60,16 +60,16 @@ def prometheus_setup_worker(labels: None | dict[str,str] = None) -> None: Monkey-patch mmap_key and ValueClass to add implicit labels. This must be done before any metrics are instantiated. """ - if labels: + if labels is not None: from prometheus_client import values - def mmap_key(metric_name: str, name: str, labelnames: tuple[str], labelvalues: tuple[str], *args) -> str: + def mmap_key(metric_name: str, name: str, labelnames: list[str], labelvalues: list[str], help_text: str) -> str: return mmap_dict.mmap_key( metric_name, name, - tuple(labels.keys()) + labelnames, - tuple(labels.values()) + labelvalues, - *args, + list(labels.keys()) + list(labelnames), + list(labels.values()) + list(labelvalues), + help_text, ) values.mmap_key = mmap_key