Skip to content

nvme: Fix namespace parsing#821

Merged
SuperQ merged 2 commits into
prometheus:masterfrom
goll:master
Jun 23, 2026
Merged

nvme: Fix namespace parsing#821
SuperQ merged 2 commits into
prometheus:masterfrom
goll:master

Conversation

@goll

@goll goll commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the namespace parsing bug introduced by #765 as the regex on L30 in class_nvme.go explicitly looks for nvme0c0n0.

Standard nvme devices will not have the c0 identifier, from what I gather that is only applicable in some multipath setups, it will just be nvme0n1 for example.

Noticed this following node_exporter upgrade that promised nvme metrics which were missing on all updated systems.

>> running all tests
go test -race  ./...
ok  	github.com/prometheus/procfs	1.132s
ok  	github.com/prometheus/procfs/bcache	1.017s
ok  	github.com/prometheus/procfs/bcachefs	1.013s
ok  	github.com/prometheus/procfs/blockdevice	1.020s
ok  	github.com/prometheus/procfs/btrfs	1.016s
?   	github.com/prometheus/procfs/ext4	[no test files]
ok  	github.com/prometheus/procfs/internal/fs	1.016s
ok  	github.com/prometheus/procfs/internal/util	(cached)
ok  	github.com/prometheus/procfs/iscsi	1.023s
ok  	github.com/prometheus/procfs/nfs	(cached)
ok  	github.com/prometheus/procfs/selinuxfs	1.015s
ok  	github.com/prometheus/procfs/sysfs	1.054s
ok  	github.com/prometheus/procfs/xfs	1.027s

Signed-off-by: goll <goll@users.noreply.github.com>
@goll

goll commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@discordianfish @SuperQ since you gentlemen handled #765

@SuperQ

SuperQ commented Jun 21, 2026

Copy link
Copy Markdown
Member

@ShashwatHiregoudar can you comment on this naming change?

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'm not sure where the cN naming comes from. I can't find any kernel documentation evidence that it's supposed to exist this way.

@SuperQ SuperQ merged commit 0155712 into prometheus:master Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants