Repository navigation
fix(nova): report capacity metrics in bytes - #2
Open
davidhulick wants to merge 1 commit into
Open
davidhulick wants to merge 1 commit into
davidhulick wants to merge 1 commit into
Conversation
Convert RAM quota and memory limits from MiB, and server root disk capacity from GiB, while preserving labels, unlimited limits and signed usage. Add capacity regression coverage and document the breaking metric migration. Signed-off-by: David Hulick <dave.hulick@gmail.com>
Author
Contribution relationshipStandalone change — targets This PR converts existing Nova capacity metrics to Prometheus base units (bytes). It does not depend on the other exporter contributions or any pending Related capacity conversions for Cinder and Manila are included separately in their respective service contributions:
Those contributions are not prerequisites for this fix. It can be reviewed and submitted upstream independently. |
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
Convert four existing Nova capacity metrics from MiB/GiB to bytes, following Prometheus metric naming and exporter best practices.
Metric changes:
openstack_nova_quota_ram→openstack_nova_quota_ram_bytes(MiB × 2^20)openstack_nova_limits_memory_max→openstack_nova_limits_memory_max_bytes(MiB × 2^20)openstack_nova_limits_memory_used→openstack_nova_limits_memory_used_bytes(MiB × 2^20)openstack_nova_server_local_gb→openstack_nova_server_local_bytes(GiB × 2^30)Motivation
The official Prometheus metric naming best practices recommend base units such as bytes rather than megabytes or gigabytes, with explicit unit suffixes. The exporter guidelines likewise recommend exposing base units and leaving human-readable conversions to visualization tools.
This PR deliberately addresses Nova first because these conversions are self-contained and require no new database APIs or accounting changes.
The remaining Cinder and Manila capacity metrics are planned for conversion alongside their respective quota and inventory improvements. Those changes affect collector behavior and dependencies, so combining the conversions with them avoids modifying legacy collectors twice.
This creates a temporary mixed-unit state during the migration but keeps each contribution independently reviewable while moving toward consistent byte-based metrics across the exporter.
Behavior and compatibility
-1for unlimited quota and memory limits.openstackdb v0.2.1.Breaking metric changes
The four old metric families are removed without aliases.
PromQL queries, dashboards, alerts, recording rules, and allowlists must use the replacement names. Existing MiB/GiB-to-byte multipliers should be removed, and thresholds expressed in bytes.
Queries spanning the rollout may need to account for historical series using previous names and units. The README documents the migration.
Related upstream work
VEXXHOST PR #117 modifies Nova accounting, defaults, and label contracts but does not implement these four conversions.
This PR preserves the current upstream labels and does not incorporate vexxhost#117's unmerged changes. If both contributions are accepted, the later contribution will need to reconcile their label contracts.