Skip to content

Add cpuinfo_avg_freq to list of CPU frequency metrics #822

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

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