Skip to content

in_node_exporter_metrics: commit 9c1998f7c regressed the 2023 fix for missing CPU thermal-throttle counters (#7589 / #7602) #12033

Description

@mommsen

Bug Report

Describe the bug

Commit 9c1998f ("in_node_exporter_metrics: add file path to error messages") regresses the fix from #7602 (for #7589). The node_exporter_metrics CPU collector again logs an error-level message every scrape interval, once per CPU core, on hosts whose kernel/CPU doesn't expose /sys/devices/system/cpu/cpuN/thermal_throttle/{core,package}_throttle_count (common on VMs and some hardware). #7602 deliberately made this debug-only in 2023 because the condition is expected and benign; 9c1998f re-added a struct flb_ne *ctx parameter to ne_utils_file_read_uint64()/ne_utils_file_read_sds() with an unconditional flb_plg_error(ctx->ins, "could not open '%s'", p) on open() failure, which now fires in addition to the caller's existing flb_plg_debug("CPU is missing core_throttle_count: %s", ...) — defeating the original fix.

To Reproduce

  • Rubular link if applicable: N/A
  • Example log message if applicable:
    [2026/07/02 07:24:29.523] [error] [input:node_exporter_metrics:node_exporter_metrics.1] could not open '/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count'
  • Steps to reproduce the problem:
    a. Run fluent-bit v5.0.8+ with a node_exporter_metrics input whose metrics list includes cpu.
    b. Run it on a host (bare metal or VM) whose kernel/CPU doesn't populate /sys/devices/system/cpu/cpuN/thermal_throttle/ for any core.
    c. Observe an [error]-level "could not open ... thermal_throttle/core_throttle_count" (and package_throttle_count) line per core, per scrape_interval.
    d. Compare against v5.0.7 with the same config/host: no error is logged (only an invisible-by-default debug line).

Expected behavior

Same as post-#7602 behavior: when the thermal-throttle sysfs files are absent, the collector should log only at debug level ("CPU is missing core_throttle_count: %s"), not error.

Screenshots

N/A

Your Environment

  • Version used: v5.0.8 (regression first appears here; confirmed absent in v5.0.7 by diffing plugins/in_node_exporter_metrics/ne_utils.c and ne_cpu_linux.c between the two tags)
  • Configuration:
    [INPUT]
    name node_exporter_metrics
    tag node_metrics
    metrics cpu,meminfo,filesystem,uname,stat,time,loadavg,vmstat,netdev,filefd,systemd
    scrape_interval 15
  • Environment name and version: N/A (not Kubernetes) — bare-metal Linux host
  • Server type and version: fluent-bit installed from the official packages.fluentbit.io/ubuntu/jammy apt repo
  • Operating System and version: Ubuntu 22.04 (jammy) container base; underlying host kernel lacks thermal_throttle sysfs entries for any core
  • Filters and plugins: node_exporter_metrics input, cpu collector; output via prometheus_exporter and loki

Additional context

This is a straight regression of a previously-fixed, previously-triaged issue (#7589 → fixed by #7602 in 2023), reintroduced ~3 years later by an unrelated "improve error messages" change. It reappeared for us after an unpinned apt-get install fluent-bit picked up v5.0.8, spamming our log aggregation (24 error lines per scrape interval on the affected host). We've worked around it downstream by pinning to v5.0.7, but flagging so the debug-only behavior for this specific known-benign case can be restored upstream (e.g. by not passing ctx through for the thermal-throttle read path, or special-casing it) without losing the path-in-message improvement for other callers where the missing file is a genuine problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions