Skip to content

cpufreq exporter repeated fails to read cpu frequency without elevated permissions. #2204

@jmunson

Description

@jmunson

Host operating system: output of uname -a

Linux 5.10.58

node_exporter version: output of node_exporter --version

node_exporter, version 1.2.2 (branch: HEAD, revision: 2664536)
build user: root@b9cb4aa2eb17
build date: 20210806-13:44:18
go version: go1.16.7
platform: linux/amd64

(from quay.io/prometheus/node-exporter@sha256:a990408ed288669bbad5b5b374fe1584e54825cde4a911c1a3d6301a907a030c which is currently tagged latest)

node_exporter command line flags

Currently using only --web.listen-address=127.0.0.1:9100 --path.procfs=/host/proc --path.sysfs=/host/sys
but have tested other variations

Are you running node_exporter in Docker?

Primarily, but behavior was reproduced outside of the container.

What did you do that produced an error?

Run node exporter on a AMD EPYC 7642 without any elevated permissions

What did you expect to see?

I expect the metric to not exist as cpuinfo_cur_freq requires root to read
-r-------- 1 root root 4096 Oct 20 17:06 /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq

What did you see instead?

The metric correctly does not exist, but an attempt to read this is made once per cpu core per update.
This can be highly impactful in environments with monitoring for failed attempts to open files such as through auditd with a rule like -a always,exit -S all -F exit=-13

It would be nice if there were a way to disable this specific metric, or if a failed attempt to read it would prevent future attempts.

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