Skip to content

feat(octavia): add project quota monitoring - #3

Open
davidhulick wants to merge 3 commits into
mainfrom
contrib/octavia-quotas-2b3
Open

davidhulick wants to merge 3 commits into
mainfrom
contrib/octavia-quotas-2b3

Conversation

@davidhulick

@davidhulick davidhulick commented Nov 19, 2026 •

Copy link
Copy Markdown

Caution

This PR is dependent on Octavia repository APIs proposed in samaritanark/openstackdb#2

Summary

Add project quota monitoring for seven Octavia resources:

  • Load balancers
  • Listeners
  • Pools
  • Members
  • Health monitors
  • L7 policies
  • L7 rules

Each resource exposes openstack_loadbalancer_quota_<resource> with tenant, tenant_id, domain_id, and type labels. The type label distinguishes limit and in_use values.

Also introduce openstack_loadbalancer_quota_up to report quota collection health independently from existing Octavia inventory health.

Implementation

Quota limits come from stored project overrides with configurable defaults. Usage is independently reconstructed from non-deleted Octavia resources rather than relying on cached quota usage counters.

Project discovery includes quota owners, usage-only projects, and Keystone projects. Idle projects receive zero usage, and projects without Keystone metadata retain their project IDs.

The collector rebuilds usage on each scrape across seven resource tables. This prioritizes observed resource counts over potentially stale cached accounting, but may increase database load. Query-plan and latency validation is planned before upstream submission.

Configuration and failure handling

  • Optional JSON quota defaults; without a file, all seven defaults are unlimited (-1).
  • Strict validation of explicitly supplied Octavia defaults.
  • Configurable SQL query timeout, defaulting to five seconds, shared by both quota reads.
  • Disabled Octavia collection ignores unused defaults and timeout configuration.
  • Failed quota collection emits quota_up=0 without partial quota data.
  • Successful empty collection emits quota_up=1.
  • Existing Octavia inventory and unrelated service metrics remain available on quota-only failures.
  • Database error diagnostics omit raw driver messages.

Dependency status

Requires Octavia repository APIs proposed in [samaritanark/openstackdb#2](samaritanark/openstackdb#2).

This library contribution is currently under review in the staging fork and has not yet been submitted to VEXXHOST upstream.

The exporter retains the canonical public openstackdb v0.2.1 dependency for now. That release does not contain the required APIs, so ordinary standalone CI cannot compile this contribution yet.

Pre-merge validation uses the public library contribution through a temporary Go workspace without committing a fork-specific dependency or replacement.

Contribution relationship

Shared prerequisite — targets main.

This PR adds Octavia quota monitoring and introduces shared exporter configuration used by the subsequent quota-monitoring contributions.

It does not depend on another exporter PR. However, it requires the pending [Octavia quota APIs in openstackdb (#2)](samaritanark/openstackdb#2).

Three additional exporter contributions are based directly on this PR:

These are parallel sibling contributions, not a sequential chain. None requires the other two.

They currently target this PR's branch so that GitHub displays only their service-specific changes. Once this contribution is merged upstream, each can be rebased onto upstream main and submitted independently when its own library dependencies are available.

Two other exporter contributions are independent of this work:

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>
@davidhulick

Copy link
Copy Markdown
Author

Before submitting upstream, we must revisit:

  1. Library dependency: Ensure Octavia openstackdb PR fix(nova): report capacity metrics in bytes #2 has been submitted to and accepted by VEXXHOST.
  2. Performance concern (F2): Investigate the cost of rebuilding usage across seven Octavia tables on every Prometheus scrape. Obtain representative EXPLAIN plans and query timings.
  3. Native integration: Verify MariaDB integration and full-exporter E2E tests actually execute and pass.
  4. Dependency and documentation: Update go.mod to the accepted public library revision and remove temporary fork/workspace references from the README.
  5. Final validation: Run ordinary CI, including Go 1.26.x compatibility, and recheck against the latest VEXXHOST main.

@davidhulick

Copy link
Copy Markdown
Author

ci fails because the dependent openstackdb libraries are not merged yet

Signed-off-by: David Hulick <dave.hulick@gmail.com>
@davidhulick davidhulick changed the title Octavia Quota Monitoring feat(octavia): add project quota monitoring Nov 20, 2026
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.

1 participant