Skip to content

Conversation

thoraxe
Copy link
Contributor

@thoraxe thoraxe commented Sep 8, 2025

Description

  • Add QuotaMetricsRepository with PostgreSQL implementation for data access
  • Add QuotaMetricsCollector with 6 new Prometheus metrics:
    • ols_quota_limit_total, ols_quota_available_total, ols_quota_utilization_percent
    • ols_token_usage_total, ols_quota_warning_subjects_total, ols_quota_exceeded_subjects_total
  • Add QuotaMetricsService with FastAPI dependency injection and singleton pattern
  • Add QuotaMetricsScheduler for automatic background updates (5-minute intervals)
  • Integrate with existing /metrics endpoint for seamless monitoring
  • Add comprehensive test coverage with 42 unit tests across 4 test files
  • Update README.md with detailed metrics documentation

Features:

  • Real-time quota utilization monitoring for users and clusters
  • Token usage tracking by provider/model with privacy considerations
  • Automatic threshold detection (warning >80%, exceeded >100%)
  • Graceful error handling with circuit breaker patterns
  • Health checks and database reconnection logic
  • Background scheduler with configurable update intervals

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

  - Add QuotaMetricsRepository with PostgreSQL implementation for data access
  - Add QuotaMetricsCollector with 6 new Prometheus metrics:
    * ols_quota_limit_total, ols_quota_available_total, ols_quota_utilization_percent
    * ols_token_usage_total, ols_quota_warning_subjects_total, ols_quota_exceeded_subjects_total
  - Add QuotaMetricsService with FastAPI dependency injection and singleton pattern
  - Add QuotaMetricsScheduler for automatic background updates (5-minute intervals)
  - Integrate with existing /metrics endpoint for seamless monitoring
  - Add comprehensive test coverage with 42 unit tests across 4 test files
  - Update README.md with detailed metrics documentation

  Features:
  - Real-time quota utilization monitoring for users and clusters
  - Token usage tracking by provider/model with privacy considerations
  - Automatic threshold detection (warning >80%, exceeded >100%)
  - Graceful error handling with circuit breaker patterns
  - Health checks and database reconnection logic
  - Background scheduler with configurable update intervals

  🤖 Generated with [Claude Code](https://claude.ai/code)

  Co-Authored-By: Claude <noreply@anthropic.com>
@openshift-ci openshift-ci bot requested review from bparees and onmete September 8, 2025 18:38
Copy link

openshift-ci bot commented Sep 8, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xrajesh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@raptorsun
Copy link
Contributor

/retest

Copy link

openshift-ci bot commented Sep 29, 2025

@thoraxe: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration aba67d7 link true /test integration
ci/prow/4.18-e2e-ols-cluster aba67d7 link true /test 4.18-e2e-ols-cluster
ci/prow/e2e-ols-cluster aba67d7 link true /test e2e-ols-cluster

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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.

2 participants