bairhys / prometheus-frigate-exporter

A Prometheus exporter for Frigate stats
MIT License
35 stars 5 forks source link

Fix storage paths for frigate_storage_mount_type_info #10

Closed Rauks closed 6 months ago

Rauks commented 6 months ago

Hello,

Trying to fix https://github.com/bairhys/prometheus-frigate-exporter/issues/9 by setting the storage label in frigate_storage_mount_type_info to the actual mount path instead to the (defaulted?) /.

This solves the duplicate series error in my side and changes the /metrics output from:

# 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="tmpfs",storage="/"} 1.0

To:

# 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="/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="tmpfs",storage="/tmp/cache"} 1.0

I also updated the sample in the README file to reflect the change.

Thanks,

bairhys commented 6 months ago

Thanks for your work on this fix, tests ok for me, merged!