Skip to content

Commit

Permalink
Merge pull request #10 from Rauks/feature/storage-mount-type-info-fix
Browse files Browse the repository at this point in the history
Fix storage paths for frigate_storage_mount_type_info
  • Loading branch information
bairhys authored May 13, 2024
2 parents d62fffc + 292e362 commit 2d3182c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions prometheus_frigate_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand All @@ -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

Expand Down

0 comments on commit 2d3182c

Please sign in to comment.