Skip to content

nvme: Deprecate metric nvme_namespace_capacity_bytes - #3899

Merged
SuperQ merged 2 commits into
prometheus:masterfrom
scarlet-storm:remove-ncap
Nov 17, 2026
Merged

SuperQ merged 2 commits into
prometheus:masterfrom
scarlet-storm:remove-ncap

Conversation

@scarlet-storm

Copy link
Copy Markdown
Contributor

This metric is currently just a duplicate of namespace_size_bytes, as seen in procfs:
https://github.com/prometheus/procfs/blob/98e16a16034c77c1277b41cc21915b70fa4631bc/sysfs/class_nvme.go#L200-L201

This is incorrect because capacity & size (ncap & nsze) have special meanings in nvme protocol.

  • ncap is the max logical blocks allocatable to the namespace.
  • nsze is the total logical blocks in the namespace.

For thin provisioned namespace ncap < nsze & the kernel does not currently have an easy way to fetch ncap.
The field should also be removed in procfs, to prevent further incorrect usage of NamespaceCapacity.

short ref. on nvme namespaces
https://nvmexpress.org/resource/nvme-namespaces/

@SuperQ

SuperQ commented Nov 12, 2026

Copy link
Copy Markdown
Member

Because this is a released metric, removing is considered a breaking change. We will need to wrap this in a boolean flag and keep it enabled by default. And probably print a Warn log that it will be removed in v2.0.

@scarlet-storm scarlet-storm changed the title nvme: remove metric nvme_namespace_capacity_bytes nvme: Deprecate metric nvme_namespace_capacity_bytes Nov 17, 2026
@scarlet-storm
scarlet-storm force-pushed the remove-ncap branch 2 times, most recently from c37c699 to 06aeb06 Compare November 17, 2026 06:22
This metric is currently just a duplicate of namespace_size_bytes, as
seen in procfs:
https://github.com/prometheus/procfs/blob/98e16a16034c77c1277b41cc21915b70fa4631bc/sysfs/class_nvme.go#L200-L201

This is incorrect because capacity & size (ncap & nsze) have special
meanings in nvme protocol.
ncap is the max logical blocks allocatable to the namespace.
nsze is the total logical blocks in the namespace.

for thin provisioned namespace ncap < nsze & the kernel does not
currently have an easy way to fetch ncap. if ncap is available in a
future kernel the metric can be added back.

Signed-off-by: scarlet-storm <[email protected]>

@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.

Thanks!

@SuperQ
SuperQ merged commit b653b21 into prometheus:master Nov 17, 2026
18 checks passed
@SuperQ SuperQ mentioned this pull request Nov 18, 2026
SuperQ added a commit that referenced this pull request Nov 18, 2026
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]>
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