fix: cinder_limits_volume_used_gb metric#94
Open
Tadas Sutkaitis (fitbeard) wants to merge 1 commit intomainfrom
Open
fix: cinder_limits_volume_used_gb metric#94Tadas Sutkaitis (fitbeard) wants to merge 1 commit intomainfrom
Tadas Sutkaitis (fitbeard) wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Tadas Sutkaitis <tadas.sutkaitis@vexxhost.com>
There was a problem hiding this comment.
Pull request overview
Fixes incorrect Cinder limits_volume_used_gb reporting when a project has usage records but no explicit quota row by separating quota limits and quota usage data sources.
Changes:
- Update Cinder quota limits query to read only
hard_limitfromquotas. - Add a new query to read
in_usedirectly fromquota_usagesand overlay it in the limits collector. - Extend unit + integration tests to cover “usage without explicit quota” (issue #92).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
sql/cinder/queries.sql |
Splits limits vs usage into distinct SQL queries (GetProjectQuotaLimits, GetProjectQuotaUsages). |
internal/db/cinder/queries.sql.go |
Regenerates sqlc output for the updated/added queries and result structs. |
internal/collector/cinder/limits.go |
Collects limits from quotas and usage from quota_usages, overlaying usage per project. |
internal/collector/cinder/limits_test.go |
Updates mocks/expected output to reflect the new query split; adds regression test for issue #92. |
internal/collector/cinder/integration_test.go |
Adds integration coverage for usage existing without quota rows. |
.gitignore |
Ignores exporter.sh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fixes: #92
Limits → read hard_limit from quotas (which only exists when explicitly set)
Usage → read in_use directly from quota_usages (which always exists when resources are consumed)