From e3dd5a41f4244e113238e0babcb81c8bb6367286 Mon Sep 17 00:00:00 2001 From: Rhys Bailey Date: Mon, 18 Mar 2024 23:02:35 +1100 Subject: [PATCH] Update prometheus_frigate_exporter.py --- prometheus_frigate_exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus_frigate_exporter.py b/prometheus_frigate_exporter.py index b3a0c51..bb15f89 100644 --- a/prometheus_frigate_exporter.py +++ b/prometheus_frigate_exporter.py @@ -13,9 +13,9 @@ def add_metric(metric, label, stats, key, multiplier=1.0): try: string = str(stats[key]) - value = float(re.findall(r'\d+', string)[0]) + value = float(re.findall(r'-?\d*\.?\d*', string)[0]) metric.add_metric(label, value * multiplier) - except (KeyError, TypeError, IndexError): + except (KeyError, TypeError, IndexError, ValueError): pass