Repository navigation
feat(octavia): add project quota monitoring - #161
Open
Jeremy Lee (legit-ninja) wants to merge 3 commits into
Open
Jeremy Lee (legit-ninja) wants to merge 3 commits into
Jeremy Lee (legit-ninja) wants to merge 3 commits into
Conversation
Export stored limits and rebuilt usage for seven Octavia resources, with project metadata fallback, defaults configuration, bounded SQL reads and separate quota health. Preserve inventory and other service registration. Requires the public openstackdb quota APIs; keep the canonical dependency until those APIs are accepted upstream. Validate through an external Go workspace in the meantime. Signed-off-by: David Hulick <dave.hulick@gmail.com>
Extend the existing full-exporter fixture with distinct resource counts, nullable and explicit limits, deleted resources and an idle project. Assert every quota family and preserve existing service assertions. Integration-tag vet passes; native MariaDB execution is pending because Docker is unavailable in the preparation environment. Signed-off-by: David Hulick <dave.hulick@gmail.com>
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
Add project quota monitoring for the seven Octavia quota resources: load balancers, listeners, pools, members, health monitors, L7 policies and L7 rules.
This also adds the shared quota configuration (
--quota.defaults-file) that the Cinder (#162), Manila (#163) and Neutron (#164) quota PRs extend.Metrics
openstack_loadbalancer_quota_{loadbalancer,listener,pool,member,healthmonitor,l7policy,l7rule}: gauges withtenant,tenant_id,domain_idandtypelabels, wheretypeislimitorin_use. No reserved values are emitted.openstack_loadbalancer_quota_up: unlabeled gauge,1when quota collection succeeds (including an empty database),0when it fails. Absent when Octavia is disabled. Separate from the existingopenstack_loadbalancer_upinventory health.Behavior
quotastable. An explicit project value wins; a NULL or missing override uses the configured default. Zero and-1are preserved.in_useis recounted from the object tables with Octavia'scheck_quota_metpredicate: the object's own project andprovisioning_status != 'DELETED'. ERROR and pending objects count. These counts can differ from Octavia's cachedin_use_*counters, which Octavia enforces against.--keystone.database-url), so idle and usage-only projects are reported. Without Keystone metadata, the project ID is used astenantanddomain_idis empty.quota_up=0and no quota samples, and leaves other metrics and the HTTP scrape intact.Configuration
--quota.defaults-file/QUOTA_DEFAULTS_FILE(optional): JSON with anoctaviasection holding all seven defaults. Without it, the exporter logs a warning and assumes Octavia 2025.2's unlimited (-1) defaults. A supplied file that is unreadable, malformed or incomplete fails startup when Octavia is enabled; it is ignored when Octavia is disabled.--octavia.quota-query-timeout/OCTAVIA_QUOTA_QUERY_TIMEOUT(default5s): shared deadline for the two quota reads. Set it below the scrape timeout.Dependencies
Requires
QuotaRepositoryfrom [vexxhost/openstackdb#11](vexxhost/openstackdb#11).go.modneeds bumping to an openstackdb release that includes it before CI can build this PR.Performance
The usage recount scans all seven Octavia object tables, which have no index on
project_idorprovisioning_status. Check query plans and latency on a representative database before enabling it on large deployments.Tests
-race).Built and tested (
go build,go vet,go test -race ./...) against openstackdb with #11 applied. MariaDB end-to-end tests have not yet been run against the rebased dependency