From 292e3629459d54740a46b06c58b08d866cc92952 Mon Sep 17 00:00:00 2001 From: Karl Woditsch Date: Sat, 11 May 2024 20:18:29 +0200 Subject: [PATCH] Fix storage paths for frigate_storage_mount_type_info --- README.md | 8 ++++---- prometheus_frigate_exporter.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index db47cfd..765d19e 100644 --- a/README.md +++ b/README.md @@ -313,10 +313,10 @@ frigate_storage_free_bytes{storage="/media/frigate/recordings"} 2e+09 frigate_storage_free_bytes{storage="/tmp/cache"} 2e+09 # HELP frigate_storage_mount_type_info Storage mount type # TYPE frigate_storage_mount_type_info gauge -frigate_storage_mount_type_info{mount_type="tmpfs",storage="/"} 1.0 -frigate_storage_mount_type_info{mount_type="ext4",storage="/"} 1.0 -frigate_storage_mount_type_info{mount_type="ext4",storage="/"} 1.0 -frigate_storage_mount_type_info{mount_type="overlay",storage="/"} 1.0 +frigate_storage_mount_type_info{mount_type="tmpfs",storage="/dev/shm"} 1.0 +frigate_storage_mount_type_info{mount_type="ext4",storage="/media/frigate/clips"} 1.0 +frigate_storage_mount_type_info{mount_type="ext4",storage="/media/frigate/recordings"} 1.0 +frigate_storage_mount_type_info{mount_type="overlay",storage="/tmp/cache"} 1.0 # HELP frigate_storage_total_bytes Storage total bytes # TYPE frigate_storage_total_bytes gauge frigate_storage_total_bytes{storage="/dev/shm"} 3e+09 diff --git a/prometheus_frigate_exporter.py b/prometheus_frigate_exporter.py index bb15f89..d349a64 100644 --- a/prometheus_frigate_exporter.py +++ b/prometheus_frigate_exporter.py @@ -267,7 +267,7 @@ def collect(self): 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']) + storage_mount_type = InfoMetricFamily('frigate_storage_mount_type', 'Storage mount type', labels=['mount_type', 'storage']) storage_total = GaugeMetricFamily('frigate_storage_total_bytes', 'Storage total bytes', labels=['storage']) storage_used = GaugeMetricFamily('frigate_storage_used_bytes', 'Storage used bytes', labels=['storage']) @@ -276,7 +276,7 @@ def collect(self): add_metric(storage_free, [storage_path], storage_stats, 'free', 1e6) # MB to bytes add_metric(storage_total, [storage_path], storage_stats, 'total', 1e6) # MB to bytes add_metric(storage_used, [storage_path], storage_stats, 'used', 1e6) # MB to bytes - storage_mount_type.add_metric(storage_path, {'mount_type': storage_stats['mount_type']}) + storage_mount_type.add_metric(storage_path, {'mount_type': storage_stats['mount_type'], 'storage': storage_path}) except KeyError: pass