Repository navigation
Add resctrl collector - #3797
Merged
Merged
Conversation
rtreffer
force-pushed
the
resctrl-collector
branch
from
August 27, 2026 20:05
c307b92 to
9b420c2
Compare
Contributor
Author
|
Build error seems unrelate. The following diff is likely unacceptable at the moment but we need the next tagged procfs version :-) - github.com/prometheus/procfs v0.21.1
+ github.com/prometheus/procfs v0.21.2-0.20260827102831-a87803ee31e3 |
rtreffer
marked this pull request as ready for review
August 27, 2026 20:17
Member
Need git rebase. |
rtreffer
force-pushed
the
resctrl-collector
branch
from
September 9, 2026 07:29
9b420c2 to
95ef0a8
Compare
Contributor
Author
|
@dongjiang1989 rebased. diff looks good, procfs is at a tagged version, the Mac OS test needs a rerun. |
Member
U can |
rtreffer
force-pushed
the
resctrl-collector
branch
8 times, most recently
from
September 21, 2026 13:19
1324402 to
45fd980
Compare
Contributor
Author
|
I think the e2e tests for Mac OS are broken, even on the main branch, PR #3825 |
Expose the Linux resctrl monitoring counters (Intel RDT, AMD PQoS, ARM MPAM): per L3 domain memory bandwidth (mbm_total_bytes, mbm_local_bytes) and last level cache occupancy (llc_occupancy). Parsing is done by the procfs resctrlfs package (procfs v0.22.0). The collector is disabled by default because the resctrl filesystem must be mounted first (mount -t resctrl resctrl /sys/fs/resctrl). The mountpoint is configurable via --collector.resctrl.path. Counters a CPU does not support (for example mbm_local_bytes on Arm MPAM) or that read "Unavailable" are skipped per sample. The hardware counters wrap; Prometheus treats the wrap as a counter reset, so no correction is applied. Signed-off-by: René Treffer <[email protected]>
rtreffer
force-pushed
the
resctrl-collector
branch
from
September 25, 2026 14:15
45fd980 to
4045179
Compare
Contributor
Author
|
@dongjiang1989 it passes now. |
Signed-off-by: René Treffer <[email protected]>
Signed-off-by: René Treffer <[email protected]>
Merged
SuperQ
added a commit
that referenced
this pull request
Nov 18, 2026
The behavior of `node_cpu_frequency_hertz` has changed. There are two different sources of data for this metric. One from the `cpu` collector, one from the `cpufreq` collector. Due to historical feature migrations the `cpufreq` collector shares the same subsystem as the `cpu` collector. This caused conflicting data behavior. An attempt to fix this was introduced in #3318. This behavior has been reverted to the previous behavior in #3795. A new flag (`--collector.cpufreq.enable-cpufreq-prefix`) has been introduced that gives the `cpufreq` a dedicated metric name subsystem (`node_cpufreq_...`). This will likely be the default in v2. * [CHANGE] netstat: Use procfs parsers for netstat, snmp and snmp6 #3796 * [CHANGE] edac: Fix no data results #3863 * [CHANGE] nvme: Deprecate metric nvme_namespace_capacity_bytes #3899 * [FEATURE] Add tainted collector for /proc/sys/kernel/tainted #3745 * [FEATURE] Add resctrl collector #3797 * [ENHANCEMENT] netstat: Add new FreeBSD metrics #3334 * [ENHANCEMENT] Add `chip` label to DRM metrics #3572 * [ENHANCEMENT] diskstats: add device-mapper backing device info metric #3676 * [ENHANCEMENT] textfile: support UTF-8 metric and label names #3729 * [ENHANCEMENT] ksmd: add general_profit metric #3778 #3894 * [BUGFIX] edac: Fix printf-style formatting in slog call #3759 * [BUGFIX] fibre_channel: fix crash when attempting to dereference invalid counters #3573 * [BUGFIX] thermal: Fix collecting Darwin temperatures without CPU power status #3767 * [BUGFIX] fibrechannel: Fix for ppc64le #3769 * [BUGFIX] cpu: Revert dup cpu frequency, add node_cpufreq flag #3795 * [BUGFIX] infiniband: skip sysfs reads for excluded devices #3824 * [BUGFIX] bcache: Fix btree_read_average_duration_seconds unit #3828 Signed-off-by: Ben Kochie <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose the Linux resctrl monitoring counters (Intel RDT, AMD PQoS, ARM MPAM): per L3 domain memory bandwidth (mbm_total_bytes, mbm_local_bytes) and last level cache occupancy (llc_occupancy). Parsing is done by the procfs resctrlfs package.
The collector is disabled by default because the resctrl filesystem must be mounted first (mount -t resctrl resctrl /sys/fs/resctrl). The mountpoint is configurable via --collector.resctrl.path.
Counters a CPU does not support (for example mbm_local_bytes on Arm MPAM) or that read "Unavailable" are skipped per sample. The hardware counters wrap; Prometheus treats the wrap as a counter reset, so no correction is applied.
Depends on a procfs release that contains the resctrlfs package (prometheus/procfs#862).
Signed-off-by: René Treffer [email protected]
Reviewers
AI disclosure: This code was written with the help of AI.
I have read through the code and verified that it works
Here is a snippet showing the metrics as exported by
node_exporterbuilt against prometheus/procfs#862You can use
sum by (instance,node) (rate(node_resctrl_memory_bandwidth_bytes_total{scope="total"}[1m]))to get an estimate of the data transferred between memory and CPU.This is particularly interesting for workloads like CPU inference, in-memory databases or vector databases.
Caveats: The
totalvalue is only available if memory access happened. The metric won't be available on every scrape. We could cache the latest value if this is an issue.