From e4ef9d58e690057433453587c57cd549212136b7 Mon Sep 17 00:00:00 2001 From: Rhys Bailey Date: Mon, 1 Jan 2024 13:21:36 +1100 Subject: [PATCH] export device temperature --- prometheus_frigate_exporter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prometheus_frigate_exporter.py b/prometheus_frigate_exporter.py index 0cbdf74..f053166 100644 --- a/prometheus_frigate_exporter.py +++ b/prometheus_frigate_exporter.py @@ -191,7 +191,14 @@ class CustomCollector(object): yield uptime_seconds yield last_updated_timestamp - # service->temperatures: no data for me + temperatures = GaugeMetricFamily('frigate_device_temperature', 'Device Temperature', labels=['device']) + try: + for device_name in stats['service']['temperatures']: + add_metric(temperatures, [device_name], stats['service']['temperatures'], device_name) + except KeyError: + pass + + yield temperatures storage_free = GaugeMetricFamily('frigate_storage_free_bytes', 'Storage free bytes', labels=['storage']) storage_mount_type = InfoMetricFamily('frigate_storage_mount_type', 'Storage mount type', labels=['storage'])