Repository navigation
collector: add tainted collector for /proc/sys/kernel/tainted - #3745
Conversation
cc89def to
fca75e8
Compare
|
Both procfs PRs are now merged: #844 — KernelTainted() implementation No new procfs release has been cut yet, so I've temporarily pinned go.mod to the merged commit pseudo-version to unblock CI. Will update to the proper release tag once available. |
|
Built and tested in our environment. All 20 taint flags are correctly exposed: This is on a clean kernel (all flags 0). The collector is working as expected. |
| github.com/prometheus/common v0.70.0 | ||
| github.com/prometheus/exporter-toolkit v0.17.1 | ||
| github.com/prometheus/procfs v0.21.1 | ||
| github.com/prometheus/procfs v0.21.2-0.20260717070424-0cd18237af6e |
|
Blocked on a tagged procfs release for Tracking: prometheus/procfs#859 Will update |
ffe6a29 to
b26e9a2
Compare
|
@arunsrini3082 can you check failing ci? |
Only DragonFly fails, and it fails at the dependency installation step (sudo exit code 100) before any tests run. FreeBSD, OpenBSD, NetBSD, Solaris, and Darwin/MacOS all pass. This is a DragonFly VM runner issue on AnyVM.org, not related to this PR. The tainted collector has //go:build linux so it doesn't affect any BSD target anyway. |
ArthurSens
left a comment
There was a problem hiding this comment.
Looks like documentation is missing in our README, could you add it to the list?
And looks like we're still waiting for the procfs release 😬
Review feedback addressed: procfs.FS cached on collector, matching !notainted build tag, README updated for node_kernel_tainted. |
Signed-off-by: Arun S <[email protected]>
Signed-off-by: Arun S <[email protected]>
Signed-off-by: Arun S <[email protected]>
Co-authored-by: Cursor <[email protected]> Signed-off-by: Arun S <[email protected]>
Store procfs.FS on the collector instead of opening it each scrape. Add matching !notainted build tag on the implementation file. Document the tainted collector and node_kernel_tainted metrics in README. Signed-off-by: Arun S <[email protected]>
0d9a365 to
f6a97bb
Compare
ArthurSens
left a comment
There was a problem hiding this comment.
whoops, I forgot to add the comment in the previous review
Signed-off-by: Arun S <[email protected]>
ArthurSens
left a comment
There was a problem hiding this comment.
LGTM, we just need a procfs release now :)
|
procfs release v0.22.0. @arunsrini3082 Please rebase it |
Signed-off-by: Arun Srinivasan <[email protected]>
Fixes build and BSD e2e failures caused by stale dependency versions left over from a bad merge. Signed-off-by: Arun S <[email protected]> Co-authored-by: Cursor <[email protected]>
Thanks. and it's up for the review. Please do the needful. |
|
Thanks and sorry for dropping the ball on this one! |
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]>
Summary
Add a
taintedcollector that exposes kernel taint flags from/proc/sys/kernel/taintedas Prometheus metrics.This revives the idea originally proposed in #1567. The review feedback
from that PR has been addressed:
prometheus/procfslibrary (companion PR:procfs: add KernelTainted() to parse /proc/sys/kernel/tainted procfs#844)
node_kernel_tainted{bit="14", flag="L"} 1Metrics
node_kernel_tainted{bit="14", flag="L"} 0
node_kernel_tainted{bit="12", flag="O"} 1
One series per known taint bit (20 total), value 0 or 1.
Disabled by default — enable with
--collector.tainted.Dependencies
The
go.modprocfs version will be bumped before merging oncethat PR is released.
Reference
https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html