Skip to content

nvme: Update nvme collector to support api changes in procfs - #3865

Merged
SuperQ merged 3 commits into
prometheus:masterfrom
scarlet-storm:nvme-optional-nuse
Oct 24, 2026
Merged

SuperQ merged 3 commits into
prometheus:masterfrom
scarlet-storm:nvme-optional-nuse

Conversation

@scarlet-storm

@scarlet-storm scarlet-storm commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The namespace nuse attribute does not exist in older kernels which caused the the nvme collector to fail on kernel < 6.8. The bug is fixed in procfs as part of prometheus/procfs#889 . This PR updates the nvme collector to support the changes made in procfs API.

Assisted-by: Claude Code (Claude Sonnet 5.5)

@scarlet-storm
scarlet-storm marked this pull request as draft October 22, 2026 09:10
@scarlet-storm

Copy link
Copy Markdown
Contributor Author

Depends on prometheus/procfs#889
PR should be merged after procfs release is done & dependency is bumped

@scarlet-storm
scarlet-storm force-pushed the nvme-optional-nuse branch 3 times, most recently from e84dcd5 to 4b9ef2c Compare October 22, 2026 12:14
@SuperQ

SuperQ commented Oct 23, 2026

Copy link
Copy Markdown
Member

I've cut procfs v0.23.0.

If you want to add this to the PR:

go get github.com/prometheus/procfs@v0.23.0

Comment thread collector/nvme_linux.go Outdated
Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com>
New procfs api removes the namespace usage fields from the struct and
adds a new method for fetching the used blocks. Update the nvme
collector to support the changes.

Also adds an option to disable nvme namespace usage metric. It is
enabled by default and can be disabled if desired via the flag
--no-collector.nvme.namespace-usage.

A namespace without a nuse file is skipped with a debug message. A read
error, for example EIO which can be returned when the controller is not
live, is logged and the other namespaces are still collected.

Assisted-by: Claude Code (Claude Sonnet 5.5)
Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com>
@scarlet-storm scarlet-storm changed the title nvme: make namespace used bytes opt-in nvme: Update nvme collector to support api changes in procfs Oct 23, 2026
@scarlet-storm
scarlet-storm marked this pull request as ready for review October 23, 2026 14:47
@scarlet-storm
scarlet-storm requested a review from SuperQ October 23, 2026 14:48
fixture update for prometheus/procfs#885

Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com>
@scarlet-storm

scarlet-storm commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

arm64 was using a different e2e file which was not updated. The arm64 e2e is fixed now

@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 going to ignore the unrelated linter issue and fix that myself.

@SuperQ
SuperQ enabled auto-merge (squash) October 24, 2026 17:12
@SuperQ
SuperQ disabled auto-merge October 24, 2026 17:14
@SuperQ
SuperQ merged commit f37c4cd into prometheus:master Oct 24, 2026
16 of 17 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