Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Query Prometheus for user storage usage and quota#1

Merged
sunu merged 10 commits into
mainfrom
prometheus-integration
Feb 26, 2026
Merged

Query Prometheus for user storage usage and quota#1
sunu merged 10 commits into
mainfrom
prometheus-integration

Conversation

@sunu

@sunu sunu commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

Replace mock-only PrometheusClient with real PromQL queries for dirsize_hard_limit_bytes (quota) and dirsize_total_size_bytes (usage), filtered by namespace. Falls back to randomized mock data (50%, 95%, or error) when the namespace is unset in development mode.

Also, show last-updated timestamp and error state in the UI.

sunu added 10 commits February 17, 2026 08:12
Replace mock-only PrometheusClient with real PromQL queries for
dirsize_hard_limit_bytes (quota) and dirsize_total_size_bytes (usage),
filtered by namespace. Falls back to randomized mock data
(50%, 95%, or error) when the namespace is unset in development mode.

Also, show last-updated timestamp and error state in the UI.
- Use Prometheus timestamp() function to get actual scrape time instead of query time
- Add namespace filtering in result parsing with dedicated helper methods
- Execute Prometheus queries concurrently with asyncio.gather for better performance
- Update docker-compose for local development with host Prometheus instance
@sunu sunu marked this pull request as ready for review February 26, 2026 08:44
@sunu sunu merged commit 84c520c into main Feb 26, 2026
6 checks passed
@sunu sunu deleted the prometheus-integration branch February 26, 2026 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant