prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
755 stars 311 forks source link

Update class_thermal.go to ignore only invalid thermal zones which raise fs.PathError #634

Closed miliacristian closed 1 month ago

miliacristian commented 2 months ago

Sum-up: ignore invalid thermal zones to avoid discharding of all thermal zone metric

Some thermal zones generates errors fs.PathError causing the lost of all metric data also for valid thermal zone.

Example of error log: ts=2024-04-10T14:23:57.064Z caller=collector.go:169 level=error msg="collector failed" name=thermal_zone duration_seconds=0.053034792 err="read /sys/class/thermal/thermal_zone24/temp: invalid argument"

miliacristian commented 1 month ago

Thanks @SuperQ