Skip to content

fix(collector): handle EINVAL errors from thermal_zone gracefully#3657

Open
superShen0916 wants to merge 1 commit into
prometheus:masterfrom
superShen0916:fix/thermal-zone-einval
Open

fix(collector): handle EINVAL errors from thermal_zone gracefully#3657
superShen0916 wants to merge 1 commit into
prometheus:masterfrom
superShen0916:fix/thermal-zone-einval

Conversation

@superShen0916
Copy link
Copy Markdown

@superShen0916 superShen0916 commented May 14, 2026

Summary

Fixes #2980 - When running node_exporter in Docker on some embedded devices, reading thermal_zone temp files can return EINVAL (invalid argument) errors. These were previously not handled, causing the entire thermal_zone collector to fail with an error instead of gracefully returning ErrNoData.

Changes

  • collector/thermal_zone_linux.go: Added syscall.EINVAL to the list of handled errors that result in ErrNoData instead of propagating as a fatal collector error

Test plan

  • go build ./collector/ succeeds

When running node_exporter in Docker on some embedded devices,
reading thermal_zone temp files can return EINVAL (invalid
argument) errors. These were previously not handled, causing
the entire thermal_zone collector to fail.

Add syscall.EINVAL to the list of errors that cause the
collector to return ErrNoData instead of failing entirely.

Fixes prometheus#2980

Signed-off-by: shenpeng.sp0916 <shenpeng.sp0916@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle thermal_zone errors gracefully

1 participant