Skip to content

Commit

Permalink
fixup! fix(deps): prometheus_client 0.16 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jvansanten committed Feb 6, 2023
1 parent 92fe495 commit 4702c65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ampel/metrics/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4702c65

Please sign in to comment.