From 3d3f146d2bfa8830ce0b71c8e4469722d73e05d6 Mon Sep 17 00:00:00 2001 From: PovilasID <396243+PovilasID@users.noreply.github.com> Date: Sat, 25 Nov 2023 15:57:47 +0200 Subject: [PATCH] fix: api endpoint ver 0.13-beta5 --- prometheus_frigate_exporter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prometheus_frigate_exporter.py b/prometheus_frigate_exporter.py index 87fdb5f..0cac1b9 100644 --- a/prometheus_frigate_exporter.py +++ b/prometheus_frigate_exporter.py @@ -35,6 +35,7 @@ class CustomCollector(object): def collect(self): stats = json.loads(urlopen(self.stats_url).read()) self.process_stats = stats['cpu_usages'] + self.cameras = stats['cameras'] # process stats for cameras, detectors and other cpu_usages = GaugeMetricFamily('frigate_cpu_usage_percent', 'Process CPU usage %', @@ -54,7 +55,7 @@ class CustomCollector(object): detection_enabled = GaugeMetricFamily('frigate_detection_enabled', 'Detection enabled for camera', labels=['camera_name']) - for camera_name, camera_stats in stats.items(): + for camera_name, camera_stats in self.cameras.items(): add_metric(camera_fps, camera_name, camera_stats, 'camera_fps') add_metric(detection_fps, camera_name, camera_stats, 'detection_fps') add_metric(process_fps, camera_name, camera_stats, 'process_fps')