Skip to content

HYPERFLEET-1360 - feat: add Grafana dashboard for adapter metrics#259

Open
tirthct wants to merge 4 commits into
openshift-hyperfleet:mainfrom
tirthct:hyperfleet-1360
Open

HYPERFLEET-1360 - feat: add Grafana dashboard for adapter metrics#259
tirthct wants to merge 4 commits into
openshift-hyperfleet:mainfrom
tirthct:hyperfleet-1360

Conversation

@tirthct

@tirthct tirthct commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Grafana dashboard JSON (charts/dashboards/hyperfleet-adapter.json) covering all 8 hyperfleet_adapter_* metric families across 8 panels
  • Update docs/metrics.md with dashboard import instructions
  • Add CHANGELOG.md entry

Details

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 from label_values(hyperfleet_adapter_events_processed_total, adapter_name)

Panels:

# Title Type Metric(s)
1 Events Processed Rate timeseries events_processed_total
2 Adapter Status stat up, build_info
3 Event Processing Duration (Percentiles) timeseries event_processing_duration_seconds
4 Error Rate by Type timeseries (stacked) errors_total
5 Resource Deletion Rate timeseries resources_deleted_total
6 Deletions In Progress timeseries resource_deletions_in_progress
7 Deletion Duration (Percentiles) timeseries resource_deletion_duration_seconds
8 Deletion Rate by Resource Type table resources_deleted_total (derived)

Design notes:

  • All histogram_quantile queries preserve adapter_name in the by clause so per-adapter percentile lines render correctly in multi-adapter environments
  • All legendFormats include {{adapter_name}} to prevent series collision when "All" is selected
  • Rate panels use unit: "ops" for explicit ops/sec display
  • Panel 2 (Adapter Status) is intentionally unfiltered by adapter_name — the underlying up/build_info metrics in pkg/health/metrics.go carry no adapter_name label. A panel description documents this.
  • Dashboard JSON will be consumed by hyperfleet-infra for Grafana provisioning (HYPERFLEET-1363)

Test plan

  • jq . charts/dashboards/hyperfleet-adapter.json parses without errors
  • make test-helm passes
  • Import into a Grafana 9.5+ instance — all 8 panels render without errors
  • Datasource variable dropdown populates available Prometheus datasources
  • adapter_name variable populates from scraped metrics
  • Selecting a specific adapter filters panels 1, 3–8; Panel 2 continues showing all instances

Screenshot

image

@openshift-ci
openshift-ci Bot requested review from kuudori and rafabene July 22, 2026 20:14
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown

[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 mliptak0 for approval. For more information see the Code Review Process.

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

Details 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

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b3a42b60-7f09-4722-b3ba-143f2233f01d

📥 Commits

Reviewing files that changed from the base of the PR and between 131a827 and bc449d3.

📒 Files selected for processing (1)
  • docs/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)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/metrics.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a pre-built Grafana “HyperFleet Adapter Metrics” dashboard with panels for events processed, adapter health/status, processing & deletion duration percentiles, error rates, and resource deletion status.
    • Added dashboard variables to choose the Prometheus data source and filter metrics by adapter name.
  • Documentation
    • Documented dashboard import/provisioning steps and updated baseline adapter metric label information.
  • Chores
    • Bumped the Helm chart version to 2.1.0 and updated changelog/docs entries to reference the new dashboard.

Walkthrough

Adds 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
Loading

Suggested reviewers: rafabene, kuudori

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a Grafana dashboard for adapter metrics.
Description check ✅ Passed The description directly covers the dashboard, docs, and changelog updates in this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sec-02: Secrets In Log Output ✅ Passed Docs-only diff; no slog/log/logr/zap/fmt.Print* calls or token/password/credential/secret fields found. CWE-532 not triggered.
No Hardcoded Secrets ✅ Passed PASS: No CWE-798/CWE-321 patterns found—no apiKey/secret/token/password literals, embedded-credential URLs, or >32-char base64 blobs in the new JSON/docs.
No Weak Cryptography ✅ Passed No weak-crypto primitives or secret comparisons found in touched files or Go source; no CWE-327/CWE-208 issue present.
No Injection Vectors ✅ Passed PASS: docs-only diff; no CWE-89/78/79/502 sinks or untrusted-input handling in changed content.
No Privileged Containers ✅ Passed Only docs/metrics.md changed; no manifests, Helm templates, or Dockerfiles were modified, and no privileged/root settings were introduced (CWE-250/CWE-269 not triggered).
No Pii Or Sensitive Data In Logs ✅ Passed PASS: PR-wide diff only adds docs/chart artifacts; no new slog/log/printf sites or data-bearing logs, so no CWE-532 exposure.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Comment @coderabbitai help to get the list of available commands.

@hyperfleet-ci-bot

hyperfleet-ci-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Risk Score: 2 — risk/medium

Signal Detail Points
PR size 939 lines (>500) +2
Sensitive paths none +0

Computed by hyperfleet-risk-scorer

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b63084e and 78783dd.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • charts/dashboards/hyperfleet-adapter.json
  • docs/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)

Comment thread charts/dashboards/hyperfleet-adapter.json
Comment thread docs/metrics.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Event-processing percentiles blend resource_kind/status per adapter
histogram_quantile groups only by le, adapter_name, so the p50/p95/p99 panels combine resource_kind and status series 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

📥 Commits

Reviewing files that changed from the base of the PR and between 78783dd and ba4289d.

📒 Files selected for processing (2)
  • charts/Chart.yaml
  • docs/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)

Comment thread docs/metrics.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant