collector: add tainted collector for /proc/sys/kernel/tainted - #3745
collector: add tainted collector for /proc/sys/kernel/tainted#3745arunsrini3082 wants to merge 4 commits into
Conversation
Signed-off-by: Arun S <arun.srinivasan@flipkart.com>
cc89def to
fca75e8
Compare
Signed-off-by: Arun S <arun.srinivasan@flipkart.com>
Signed-off-by: Arun S <arun.srinivasan@flipkart.com>
|
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. |
| @@ -0,0 +1,76 @@ | |||
| // Copyright 2024 The Prometheus Authors | |||
There was a problem hiding this comment.
blocking: needs the year-less copyright header, // Copyright The Prometheus Authors. make check_license rejects 2024 here.
| @@ -0,0 +1,103 @@ | |||
| // Copyright 2024 The Prometheus Authors | |||
There was a problem hiding this comment.
blocking: same header issue as tainted_linux.go.
| 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 |
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