Skip to content

feat(DM01-6252): add API performance Grafana dashboard and build.created_at index - #640

Open
liuwei08 wants to merge 2 commits into
masterfrom
feat/DM01-6252
Open

feat(DM01-6252): add API performance Grafana dashboard and build.created_at index#640
liuwei08 wants to merge 2 commits into
masterfrom
feat/DM01-6252

Conversation

@liuwei08

@liuwei08 liuwei08 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add api_performance_dashboard.json — new Grafana dashboard with two rows:
    • Project Activity (works immediately with existing data): CPU allocation by project (Prometheus stacked graph), most active projects table with running/queued counts (Postgres), build submission rate per project per minute (Postgres)
    • API Request Metrics (ready for Flask middleware, shows "No data" until deployed): endpoint request rate top-15 (Prometheus), top endpoints by volume table, API latency p95 per endpoint with warning/critical thresholds
  • Set dashboard auto-refresh to 5m to avoid excess DB load from Postgres panels
  • Add migration 00049 to create build_created_at_idx on build(created_at), eliminating full sequential scans on time-range queries

Context

Part of DM01-6252 / DM01-6243 — InfraBox performance investigation.

The existing Prometheus metrics server only exposes job counts and resource allocation. This dashboard adds visibility into which projects drive the most load, using existing data sources immediately, with placeholder panels ready for the upcoming Flask request metrics middleware.

Risk

  • No application code changes — Grafana picks up the new JSON via file provisioning on next restart
  • Migration 00049 uses IF NOT EXISTS; safe to re-run. Migration runner kills all connections before applying migrations so no CONCURRENTLY is needed

…ted_at index

- Add api_performance_dashboard.json with two rows:
  - Project Activity: CPU allocation by project (Prometheus), most active
    projects table and build submission rate (Postgres) — works immediately
    with existing data sources
  - API Request Metrics: endpoint request rate, top endpoints table and
    latency p95 panels (Prometheus) — ready for when Flask middleware is
    added, show "No data" until then
- Set dashboard auto-refresh to 5m to avoid excess DB load
- Add migration 00049 to create build_created_at_idx, eliminating full
  table scans on time-range queries against the build table
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