Update prometheus.py

This commit is contained in:
Mitch Ross 2023-04-24 22:56:36 -04:00
parent fbc32a0da3
commit 2ea18388fa

View File

@ -12,7 +12,13 @@ def setupRegistry() -> CollectorRegistry:
return myregistry
def add_metric(metric: GaugeMetricFamily, label: str, stats: Dict[str, Any], key: str, multiplier: float = 1.0) -> None:
def add_metric(
metric: GaugeMetricFamily,
label: str,
stats: Dict[str, Any],
key: str,
multiplier: float = 1.0,
) -> None:
try:
string = str(stats[key])
value = float(re.findall(r"\d+", string)[0])