Skip to content

Error handling in ClassCoolingDeviceStats #746

Closed

Description

@MykolaBalakin

On my machine, reading some cooling devices cur_state throws a EINVAL error, so none of the thermal or cooling device metrics are gathered at all. I feel like it may need some error handling. I would happily push a PR with that, something similar to #705 or #300. If that sounds reasonable, I need some advice from the maintainers about what is the best way to handle errors — provide a default value for the metric that causes an error, skip the device with such a metric at all, or something else.

Activity

  1. discordianfish commented on Nov 12, 2025

    @discordianfish
    Member

    I'd need to have more details to say for sure, but it sounds reasonable

  2. malcolmr commented on Feb 21, 2026

    @malcolmr
    Contributor

    Same issue here, fwiw: reading cur_state returns EINVAL on one of my devices, and so none of the cooling device stats are available.

    /sys/class/thermal/cooling_device14$ cat type cur_state max_state
    TFN1
    cat: cur_state: Invalid argument
    50

    I assume this is also the root cause for prometheus/node_exporter/issues/3420 (which is how I found this issue).

  3. discordianfish commented on Feb 23, 2026

    @discordianfish
    Member

    Yeah I guess we should just skip these. PRs welcome!

  4. added a commit that references this issue on Feb 23, 2026
    b680f85
  5. added a commit that references this issue on Feb 25, 2026
    091f46c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions