collector: add nvmesubsystem collector for NVMe-oF path health#3579
Open
sradco wants to merge 2 commits intoprometheus:masterfrom
Open
collector: add nvmesubsystem collector for NVMe-oF path health#3579sradco wants to merge 2 commits intoprometheus:masterfrom
sradco wants to merge 2 commits intoprometheus:masterfrom
Conversation
742c1b1 to
a0a146e
Compare
Author
|
Hi @SuperQ , I created this PR for a new multipath collector. |
a0a146e to
1fa2099
Compare
1fa2099 to
635b613
Compare
jsafrane
reviewed
Mar 13, 2026
There was a problem hiding this comment.
The code looks good to me. I tested it with 2 NVMe over TCP devices, I got:
node_nvmesubsystem_info{iopolicy="numa",model="Linux",nqn="tempdisk",serial="bab529a0f32e397e1319",subsystem="nvme-subsys0"} 1
node_nvmesubsystem_path_state{controller="nvme0",state="connecting",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme0",state="dead",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme0",state="live",subsystem="nvme-subsys0",transport="tcp"} 1
node_nvmesubsystem_path_state{controller="nvme0",state="resetting",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme0",state="unknown",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme1",state="connecting",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme1",state="dead",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme1",state="live",subsystem="nvme-subsys0",transport="tcp"} 1
node_nvmesubsystem_path_state{controller="nvme1",state="resetting",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_path_state{controller="nvme1",state="unknown",subsystem="nvme-subsys0",transport="tcp"} 0
node_nvmesubsystem_paths_live{subsystem="nvme-subsys0"} 2
node_nvmesubsystem_paths_total{subsystem="nvme-subsys0"} 2
Which looks reasonable.
Comment on lines
+64
to
+70
| switch raw { | ||
| case "live", "connecting", "resetting", "dead": | ||
| return raw | ||
| case "deleting", "deleting (no IO)", "new": | ||
| return raw | ||
| default: | ||
| return "unknown" |
There was a problem hiding this comment.
for the record, I checked that this is a complete list of all states reported by the kernel today.
51fb644 to
8acec17
Compare
3 tasks
17875ea to
d7d2b27
Compare
d7d2b27 to
1a4cac6
Compare
Author
|
PR is failing since its based on prometheus/procfs#797, which is still not merged |
sysfs metrics Add a new disabled-by-default collector that reads /sys/block/dm-* to discover Device Mapper multipath devices and expose path health metrics. Multipath devices are identified by checking that dm/uuid starts with "mpath-", which distinguishes them from LVM or other DM device types. The path state is reported as-is from /sys/block/<dev>/device/state, supporting both SCSI devices (running, offline, blocked, etc.) and NVMe devices (live, connecting, dead, etc.) without hardcoding a fixed set of states. All device-level metrics include both the DM friendly name (device) and the kernel block device name (sysfs_name, e.g. dm-0) to enable direct correlation with node_disk_* I/O metrics without recording rules. No special permissions are required — the collector reads only world-readable sysfs attributes. Exposed metrics: - node_dmmultipath_device_info - node_dmmultipath_device_active - node_dmmultipath_device_size_bytes - node_dmmultipath_device_paths - node_dmmultipath_device_paths_active - node_dmmultipath_device_paths_failed - node_dmmultipath_path_state Signed-off-by: Shirly Radco <sradco@redhat.com> Co-authored-by: AI Assistant <noreply@cursor.com>
04fd251 to
705c86e
Compare
705c86e to
831958f
Compare
5 tasks
Add a new disabled-by-default collector that reads /sys/class/nvme-subsystem/ to expose NVMe over Fabrics subsystem path health metrics. Exposed metrics: - node_nvmesubsystem_info: subsystem identity (NQN, model, serial, iopolicy) - node_nvmesubsystem_namespace_info: maps namespace device to subsystem - node_nvmesubsystem_paths: total controller paths per subsystem - node_nvmesubsystem_paths_live: live controller paths per subsystem - node_nvmesubsystem_path_state: per-controller state (live, connecting, dead, etc.) The namespace_info metric enables precise correlation between NVMe block devices (e.g. nvme0n1) and their parent subsystems for workload-aware storage path health alerting. Enable with --collector.nvmesubsystem Depends on: prometheus/procfs#797 Signed-off-by: Shirly Radco <sradco@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
831958f to
b614bb3
Compare
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.
Summary
Add a new disabled-by-default
nvmesubsystemcollector that reads/sys/class/nvme-subsystem/to expose NVMe over Fabrics subsystem path health metrics.Exposed metrics
node_nvmesubsystem_infonode_nvmesubsystem_namespace_infonode_nvmesubsystem_pathsnode_nvmesubsystem_paths_livenode_nvmesubsystem_path_stateThe
namespace_infometric enables precise correlation between NVMe block devices (e.g.nvme0n1) and their parent subsystems, which is needed for workload-aware storage path health alerting in Kubernetes environments.Enable
No special permissions required — reads only world-readable sysfs attributes.
Dependencies
Test plan