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 @@ from prometheus_client import start_http_server 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