Skip to content

Add cpuinfo_avg_freq to list of CPU frequency metrics #822

Closed

Description

@mrobbert

cpuinfo_avg_freq was recently added as an optional sysfs attribute to the Linux kernel and I would like for it to be exposed in this library for use in node_exporter. Here is the information on its introduction - https://lkml.iu.edu/2501.3/07185.html

Here is what it looks like on my openSUSE Leap 15.6 system

# ls -l /sys/devices/system/cpu/cpu0/cpufreq/
total 0
-r--r--r-- 1 root root 4096 May 20 11:15 affected_cpus
-r--r--r-- 1 root root 4096 May 20 11:15 cpuinfo_avg_freq
-r--r--r-- 1 root root 4096 May 12 10:25 cpuinfo_max_freq
-r--r--r-- 1 root root 4096 May 12 10:25 cpuinfo_min_freq
-r--r--r-- 1 root root 4096 May 12 15:15 cpuinfo_transition_latency
-r--r--r-- 1 root root 4096 May 12 15:15 related_cpus
-r--r--r-- 1 root root 4096 May 12 15:15 scaling_available_governors
-r--r--r-- 1 root root 4096 May 12 10:25 scaling_cur_freq
-r--r--r-- 1 root root 4096 May 12 15:15 scaling_driver
-rw-r--r-- 1 root root 4096 May 12 15:15 scaling_governor
-rw-r--r-- 1 root root 4096 May 12 15:15 scaling_max_freq
-rw-r--r-- 1 root root 4096 May 12 15:15 scaling_min_freq
-rw-r--r-- 1 root root 4096 May 12 15:15 scaling_setspeed

# cat /sys/devices/system/cpu/cpu0/cpufreq/*
0
1456572
3700000
1000000
0
0
performance powersave
1000000
intel_pstate
powersave
3700000
1000000
<unsupported>

I think that this would be a simple change so I can provide a PR if you'd like, but maybe it is easier for an existing developer to add it.

Activity

  1. SuperQ commented on Jun 23, 2026

    @SuperQ
    Member

    I'm fine with exposing this from procfs, but I'm not sure this is going to be useful for the node_exporter.

    The existing scaling_cur_freq provides good enough information and given that these values are only accurate at "a few milliseconds" time range they're never going to provide "accurate" data at a typical 15-60s scrape interval.

  2. mrobbert commented on Jun 23, 2026

    @mrobbert
    ContributorAuthor

    I understand the concerns regarding accuracy at long scrape intervals, but I believe adding support for cpuinfo_avg_freq remains valuable. In our environment, we have several servers where scaling_cur_freq is either missing at the kernel level or inaccessible to node_exporter due to unprivileged user permissions.

    While investigating why scaling_cur_freq appeared stagnant at 1GHz during high-load stress tests, we found that cpuinfo_avg_freq provided much more representative data. Even if these metrics don't offer millisecond-level precision, they are sufficient for us to verify that the scaling governor isn't incorrectly pinning our CPUs to their lowest frequency state.

    For context, we are observing this on OpenSUSE Leap 15.6 (kernel 6.4.0-[######].23.81-default) using the intel_pstate driver with the powersave governor. Having this data available in node_exporter would be a helpful troubleshooting aid for these specific configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions