HYPERFLEET-1360 - feat: add Grafana dashboard for adapter metrics - #259
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a Grafana dashboard with eight Prometheus-backed panels for adapter events, health, errors, and resource deletions. It defines datasource and adapter filtering variables, a 30-second refresh interval, and a one-hour default time range. Metrics documentation adds label corrections and import instructions. The Helm chart version and changelog are updated. Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant Grafana
participant Prometheus
Operator->>Grafana: Import dashboard and select variables
Grafana->>Prometheus: Execute filtered PromQL queries
Prometheus-->>Grafana: Return adapter metric results
Grafana-->>Operator: Render eight panels
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 | 939 lines (>500) | +2 |
| Sensitive paths | none | +0 |
Computed by hyperfleet-risk-scorer
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/dashboards/hyperfleet-adapter.json`:
- Around line 1-908: Update the chart version in Chart.yaml from 2.0.0 to the
next appropriate version so it reflects the newly added hyperfleet-adapter
dashboard artifact. Leave the dashboard JSON unchanged and preserve valid Helm
chart versioning.
In `@docs/metrics.md`:
- Around line 128-137: Update the Baseline Metrics table in docs/metrics.md to
remove adapter_name from the label lists for hyperfleet_adapter_up and
build_info, matching the metric definitions in buildInfo and upGauge. Leave the
dashboard import guidance unchanged.
🪄 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: fccd26ff-ed04-4d5d-aac3-4997d0ad5171
📒 Files selected for processing (3)
CHANGELOG.mdcharts/dashboards/hyperfleet-adapter.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)
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/metrics.md (1)
126-135: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winEvent-processing percentiles blend resource_kind/status per adapter
histogram_quantilegroups only byle, adapter_name, so the p50/p95/p99 panels combineresource_kindandstatusseries within each adapter. Add those labels to the aggregation or document the intentional roll-up.🤖 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 `@docs/metrics.md` around lines 126 - 135, The dashboard’s event-processing percentile queries aggregate only by le and adapter_name, combining resource_kind and status series. Update the relevant histogram_quantile panel queries in hyperfleet-adapter.json to preserve resource_kind and status in the aggregation, or explicitly document the intentional roll-up in the dashboard documentation.Source: Path instructions
🤖 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 `@docs/metrics.md`:
- Around line 19-20: Update the documentation statement describing adapter
metric labels to explicitly exclude the baseline metrics hyperfleet_adapter_up
and hyperfleet_adapter_build_info, while preserving their documented label sets
and aligning the wording with HyperFleet architecture standards.
---
Outside diff comments:
In `@docs/metrics.md`:
- Around line 126-135: The dashboard’s event-processing percentile queries
aggregate only by le and adapter_name, combining resource_kind and status
series. Update the relevant histogram_quantile panel queries in
hyperfleet-adapter.json to preserve resource_kind and status in the aggregation,
or explicitly document the intentional roll-up in the dashboard documentation.
🪄 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: a06afcf2-df38-4873-935c-d799ce987b58
📒 Files selected for processing (2)
charts/Chart.yamldocs/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)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kuudori The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
773f64c
into
openshift-hyperfleet:main
Summary
charts/dashboards/hyperfleet-adapter.json) covering all 8hyperfleet_adapter_*metric families across 8 panelsdocs/metrics.mdwith dashboard import instructionsCHANGELOG.mdentryDetails
Dashboard mirrors the sentinel reference (
deployments/dashboards/sentinel-metrics.json): schema version 38, 4×2 grid layout, dark style, shared crosshair tooltip.Template variables:
datasource— Prometheus datasource picker (parameterized, no hardcoded UIDs)adapter_name— multi-select with "All" default, populated fromlabel_values(hyperfleet_adapter_events_processed_total, adapter_name)Panels:
events_processed_totalup,build_infoevent_processing_duration_secondserrors_totalresources_deleted_totalresource_deletions_in_progressresource_deletion_duration_secondsresources_deleted_total(derived)Design notes:
histogram_quantilequeries preserveadapter_namein thebyclause so per-adapter percentile lines render correctly in multi-adapter environments{{adapter_name}}to prevent series collision when "All" is selectedunit: "ops"for explicit ops/sec displayadapter_name— the underlyingup/build_infometrics inpkg/health/metrics.gocarry noadapter_namelabel. A panel description documents this.hyperfleet-infrafor Grafana provisioning (HYPERFLEET-1363)Test plan
jq . charts/dashboards/hyperfleet-adapter.jsonparses without errorsmake test-helmpassesadapter_namevariable populates from scraped metricsScreenshot