HYPERFLEET-1361 - feat: Add Grafana dashboard for API and DB metrics#311
HYPERFLEET-1361 - feat: Add Grafana dashboard for API and DB metrics#311tirthct wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughAdds a 12-panel Grafana dashboard for HyperFleet API, reconciliation, and database metrics with a parameterized Prometheus datasource and one-hour default range. Documents import steps and expected reconciliation gauge behavior, updates the changelog, and bumps the Helm chart version and README badge to 1.2.0. Sequence Diagram(s)sequenceDiagram
participant Grafana
participant Prometheus
participant HyperFleet API
Grafana->>Prometheus: Query configured HyperFleet metrics
Prometheus->>HyperFleet API: Collect exposed metric series
Prometheus-->>Grafana: Return metric results
Grafana-->>Grafana: Render dashboard panels
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Risk Score: 2 —
|
| Signal | Detail | Points |
|---|---|---|
| PR size | 1223 lines (>500) | +2 |
| Sensitive paths | none | +0 |
Computed by hyperfleet-risk-scorer
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@charts/Chart.yaml`:
- Line 5: Add a short note to charts/templates/NOTES.txt mentioning the bundled
charts/dashboards/hyperfleet-api.json dashboard, alongside the existing API,
validation schema, and JWT settings notes, so install and upgrade output
includes this user-facing artifact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: ee8bf80a-5749-467a-af9e-0ec817167be8
📒 Files selected for processing (5)
CHANGELOG.mdcharts/Chart.yamlcharts/README.mdcharts/dashboards/hyperfleet-api.jsondocs/metrics.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
| description: HyperFleet API - Cluster Lifecycle Management Service | ||
| type: application | ||
| version: 1.1.0 | ||
| version: 1.2.0 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
fd -p 'NOTES.txt' charts | xargs -I{} sh -c 'echo "--- {} ---"; cat {}'Repository: openshift-hyperfleet/hyperfleet-api
Length of output: 2053
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== chart files referencing dashboard =="
rg -n --hidden --glob 'charts/**' -i 'dashboard|grafana' charts || true
echo
echo "== chart NOTES file =="
cat -n charts/templates/NOTES.txtRepository: openshift-hyperfleet/hyperfleet-api
Length of output: 2608
Add the bundled dashboard to charts/templates/NOTES.txt
charts/dashboards/hyperfleet-api.json ships with the chart, but the NOTES file only covers the API, validation schema, and JWT settings. Add a short dashboard note so install/upgrade output covers the user-facing artifact.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@charts/Chart.yaml` at line 5, Add a short note to charts/templates/NOTES.txt
mentioning the bundled charts/dashboards/hyperfleet-api.json dashboard,
alongside the existing API, validation schema, and JWT settings notes, so
install and upgrade output includes this user-facing artifact.
Source: Path instructions
Summary
charts/dashboards/hyperfleet-api.json) covering all 11hyperfleet_api_*andhyperfleet_db_*Prometheus metrics across 12 panelsdocs/metrics.mdto replace the stub dashboard section with actual import instructions, coverage inventory, and behavioral notesDashboard panels
requests_totalsum by (code) (rate(...))build_inforequest_duration_secondshistogram_quantileP50/P95/P99requests_total{code=~"5.."}sum by (path) (rate(...))reconciliation_started_totalsum by (resource_type, is_delete) (rate(...))resource_pending_reconciliationmax by (resource_type, is_delete)resource_pending_reconciliation_stuckmax by (resource_type, is_delete)resource_pending_reconciliation_stuck_duration_secondsmax by (resource_type, is_delete)db_query_duration_secondshistogram_quantileP50/P95/P99db_errors_totalsum by (error_type) (rate(...))db_connections_open+db_connections_in_usesum(...)requests_totaltopk(10, ...)instant tableDesign decisions
max by(identical SQL results), connection pool usessum(per-instance)Test plan
helm-testCI check passes (make helm-docsalready run)charts/README.mdreflects version 1.2.0