Skip to content

fix: cinder_limits_volume_used_gb metric#94

Open
Tadas Sutkaitis (fitbeard) wants to merge 1 commit intomainfrom
fix/cinder_limits_volume_used_gb
Open

fix: cinder_limits_volume_used_gb metric#94
Tadas Sutkaitis (fitbeard) wants to merge 1 commit intomainfrom
fix/cinder_limits_volume_used_gb

Conversation

@fitbeard
Copy link
Copy Markdown
Contributor

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)

Signed-off-by: Tadas Sutkaitis <tadas.sutkaitis@vexxhost.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_limit from quotas.
  • Add a new query to read in_use directly from quota_usages and 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.

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.

Bug for cinder limits_volume_used_gb

2 participants