Repository navigation
fix: expose Nova capacity metrics in bytes - #160
Open
Jeremy Lee (legit-ninja) wants to merge 1 commit into
Open
Jeremy Lee (legit-ninja) wants to merge 1 commit into
Jeremy Lee (legit-ninja) 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>
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 Nova capacity metrics from MiB/GiB to bytes, following the Prometheus guidance to use base units with explicit unit suffixes, and the exporter guidelines.
Behavior
-1(unlimited) is preserved for quota and memory limits only. Zero stays zero; signed usage, including negative values, is scaled.server_local_bytesstill measures onlyinstances.root_gb; it excludes ephemeral disk, swap and actual disk use.Breaking metric changes
The four old metric families are removed without aliases. Update PromQL queries, dashboards, alerts, recording rules and allowlists to the new names, remove any MiB/GiB-to-byte multipliers, and express thresholds in bytes. Filter unlimited limits before arithmetic, for example
openstack_nova_quota_ram_bytes{type="limit"} >= 0. Queries spanning the rollout need to handle the old series separately. The README documents the migration.Scope
Nova is converted first because these changes are self-contained and need no new database APIs. The Cinder and Manila capacity metrics move to bytes in #162 and #163, alongside their quota changes, so the exporter is mixed-unit only until those merge.
#117 also changes Nova accounting and labels but not these conversions. This PR keeps the current upstream labels; if both are accepted, the later one needs to reconcile the label contracts.
Tests
Unit tests for the unit conversions (including
## Summary-1, zero and negative usage) and inventory capacity, plus updated end-to-end metric expectations. No openstackdb changes are needed.Convert four Nova capacity metrics from MiB/GiB to bytes, following the Prometheus guidance to use [base units](https://prometheus.io/docs/practices/naming/#base-units) with explicit unit suffixes, and the [exporter guidelines](https://prometheus.io/docs/instrumenting/writing_exporters/#naming).
openstack_nova_quota_ramopenstack_nova_quota_ram_bytesopenstack_nova_limits_memory_maxopenstack_nova_limits_memory_max_bytesopenstack_nova_limits_memory_usedopenstack_nova_limits_memory_used_bytesopenstack_nova_server_local_gbopenstack_nova_server_local_bytesBehavior
-1(unlimited) is preserved for quota and memory limits only. Zero stays zero; signed usage, including negative values, is scaled.server_local_bytesstill measures onlyinstances.root_gb; it excludes ephemeral disk, swap and actual disk use.Breaking metric changes
The four old metric families are removed without aliases. Update PromQL queries, dashboards, alerts, recording rules and allowlists to the new names, remove any MiB/GiB-to-byte multipliers, and express thresholds in bytes. Filter unlimited limits before arithmetic, for example
openstack_nova_quota_ram_bytes{type="limit"} >= 0. Queries spanning the rollout need to handle the old series separately. The README documents the migration.Scope
Nova is converted first because these changes are self-contained and need no new database APIs. The Cinder and Manila capacity metrics move to bytes in #162 and #163, alongside their quota changes, so the exporter is mixed-unit only until those merge.
[#117](#117) also changes Nova accounting and labels but not these conversions. This PR keeps the current upstream labels; if both are accepted, the later one needs to reconcile the label contracts.
Tests
Unit tests for the unit conversions (including
-1, zero and negative usage) and inventory capacity, plus updated end-to-end metric expectations. No openstackdb changes are needed.