Skip to content

Commit

Permalink
Update prometheus_frigate_exporter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bairhys committed Mar 18, 2024
1 parent 9b4af20 commit e3dd5a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus_frigate_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit e3dd5a4

Please sign in to comment.