Skip to content

HYPERFLEET-1363 - feat: add Grafana dashboard provisioning to Helm chart - #241

Open
Ruclo wants to merge 1 commit into
openshift-hyperfleet:mainfrom
Ruclo:HYPERFLEET-1363
Open

HYPERFLEET-1363 - feat: add Grafana dashboard provisioning to Helm chart#241
Ruclo wants to merge 1 commit into
openshift-hyperfleet:mainfrom
Ruclo:HYPERFLEET-1363

Conversation

@Ruclo

@Ruclo Ruclo commented Aug 4, 2026

Copy link
Copy Markdown

Why

Part of HYPERFLEET-1363 — unify observability values under monitoring: across all HyperFleet component charts and consolidate dashboard provisioning.

Changes

  • Move tracing under monitoring: section
  • Move dashboard JSON to charts/dashboards/, add ConfigMap template (grafana_dashboard: "1")
  • Rename serviceMonitor additionalLabelslabels
  • Default sampler to parentbased_always_on

Test plan

  • make test-helm passes
  • Deploy with OBSERVABILITY_ENABLED=true — dashboard appears in Grafana

@openshift-ci
openshift-ci Bot requested review from jsell-rh and ma-hill August 4, 2026 11:40
@openshift-ci

openshift-ci Bot commented Aug 4, 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 ciaranroche 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 Aug 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added an optional Grafana dashboard for Sentinel resource, polling, event, and error metrics.
    • Added Kubernetes dashboard provisioning support.
  • Breaking Changes

    • Renamed ServiceMonitor label configuration and moved tracing settings under monitoring.
    • Changed the default distributed tracing sampler to parentbased_always_on.
  • Documentation

    • Updated monitoring, deployment, metrics, and operational guidance.
  • Chores

    • Updated the Helm chart version to 1.1.0.

Walkthrough

This pull request adds eight Prometheus-backed Grafana panels for HyperFleet Sentinel metrics. Helm creates a Grafana-discoverable ConfigMap when dashboard provisioning is enabled. Tracing moves under monitoring.tracing, ServiceMonitor additionalLabels becomes labels, and the default sampler changes to parentbased_always_on with an empty samplerArg. Templates, schema validation, documentation, and chart metadata reflect these changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Helm
  participant ConfigMap
  participant Grafana
  participant Prometheus
  Helm->>ConfigMap: Render dashboard when monitoring.dashboard.enabled=true
  ConfigMap->>Grafana: Apply dashboard discovery labels
  Grafana->>Prometheus: Query Sentinel metrics using dashboard variables
  Prometheus-->>Grafana: Return filtered metric series
  Grafana-->>Grafana: Render eight dashboard panels
Loading

Suggested reviewers: rafabene, jsell-rh, aredenba-rh, ma-hill


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Sec-02: Secrets In Log Output ❌ Error CWE-532: test/integration/testcontainer.go:53 logs amqpURL as amqp_url; lines 35-36 set RabbitMQ username/password, and this file is not excluded. Do not log the AMQP URL. Log only non-sensitive connection metadata, or redact userinfo before passing the value to Extra.
✅ Passed checks (10 passed)
Check name Status Explanation
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.
No Hardcoded Secrets ✅ Passed No hardcoded secrets found; added-line scans found no secret literals, keys, tokens, private keys, or encoded values. Credential URLs are documented placeholders only (CWE-798 not triggered).
No Weak Cryptography ✅ Passed The patch changes only Helm, documentation, and dashboard files; searches found no banned primitives, ECB, HMAC comparisons, or custom cryptographic code.
No Injection Vectors ✅ Passed Changed files add no SQL, exec.Command, template.HTML, or yaml.Unmarshal patterns; the dashboard is static JSON embedded with .Files.Get, so no CWE-78/79/89/502 vector is introduced.
No Privileged Containers ✅ Passed No forbidden privilege settings were added. Helm defaults use runAsNonRoot/65532, drop ALL, and allowPrivilegeEscalation=false; Dockerfile root is documented for build setup and runtime uses 65532.
No Pii Or Sensitive Data In Logs ✅ Passed No changed file contains slog/logr/zap/log/fmt.Print* logging statements; added content is Helm configuration and Prometheus queries without PII, bodies, session IDs, or credentialed hostnames.
Title check ✅ Passed The title clearly identifies the primary change: Grafana dashboard provisioning in the Helm chart.
Description check ✅ Passed The description directly explains the observability configuration changes and dashboard provisioning work.
✨ 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 Aug 4, 2026

Copy link
Copy Markdown

Risk Score: 1 — risk/low

Signal Detail Points
PR size 208 lines (>200) +1
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: 3

🤖 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/values.yaml`:
- Line 244: Preserve backward compatibility for the renamed monitoring values:
update the ServiceMonitor templates to fall back from
monitoring.serviceMonitor.labels to monitoring.serviceMonitor.additionalLabels,
and support the previous top-level tracing path alongside monitoring.tracing
with an explicit precedence rule. Apply the same compatibility handling wherever
these values are consumed, or clearly mark the chart change as breaking and
provide migration guidance.
- Line 244: Update charts/values.schema.json to remove the obsolete top-level
tracing definition and add schemas for monitoring.tracing, monitoring.dashboard,
and monitoring.serviceMonitor.labels matching the corresponding
charts/values.yaml paths. Define obsolete-key handling so unsupported
configuration keys are rejected or otherwise explicitly validated, preventing
unvalidated chart values.
- Around line 271-291: Update charts/Chart.yaml to bump the Helm chart version,
add CHANGELOG.md entries covering dashboard provisioning, tracing,
ServiceMonitor configuration renames, and the parentbased_always_on sampler
default, marking configuration renames as BREAKING CHANGE, then regenerate
charts/README.md so documented paths and defaults match the current values
configuration.
🪄 Autofix

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: 39877c45-1aee-42c7-9e54-cfdaca476f88

📥 Commits

Reviewing files that changed from the base of the PR and between e3c79d5 and 75e95d3.

📒 Files selected for processing (5)
  • charts/dashboards/sentinel-metrics.json
  • charts/templates/configmap-dashboard.yaml
  • charts/templates/deployment.yaml
  • charts/templates/servicemonitor.yaml
  • charts/values.yaml
🔗 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/values.yaml
Comment thread charts/values.yaml
@Ruclo
Ruclo marked this pull request as draft August 4, 2026 12:15
@Ruclo
Ruclo force-pushed the HYPERFLEET-1363 branch from 75e95d3 to 5914e44 Compare August 4, 2026 14:03
@Ruclo
Ruclo marked this pull request as ready for review August 4, 2026 14:04
@openshift-ci
openshift-ci Bot requested review from aredenba-rh and rafabene August 4, 2026 14:04
@Ruclo
Ruclo force-pushed the HYPERFLEET-1363 branch from 5914e44 to d89d444 Compare August 4, 2026 14:06

@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

🧹 Nitpick comments (1)
charts/templates/configmap-dashboard.yaml (1)

10-11: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Fail fast if the dashboard file is missing.

.Files.Get returns an empty string when the path does not resolve. It does not raise an error. If dashboards/sentinel-metrics.json gets renamed or moved, this template silently renders a ConfigMap with empty data. The Grafana sidecar then finds a dashboard entry with no content, and nobody gets a signal at deploy time.

Wrap the call with required to fail the render instead.

Proposed fix
 data:
   sentinel-metrics.json: |-
-    {{- .Files.Get "dashboards/sentinel-metrics.json" | nindent 4 }}
+    {{- required "dashboards/sentinel-metrics.json not found in chart" (.Files.Get "dashboards/sentinel-metrics.json") | nindent 4 }}
🤖 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/templates/configmap-dashboard.yaml` around lines 10 - 11, Update the
dashboard content expression under the sentinel-metrics.json ConfigMap key to
wrap .Files.Get for dashboards/sentinel-metrics.json with Helm’s required
helper, supplying a descriptive missing-file message so template rendering fails
when the file is absent while preserving the existing nindent formatting.
🤖 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: Update the chart version in Chart.yaml from 1.1.0 to 2.0.0 to reflect
the breaking values contract, then regenerate the associated version badge and
chart documentation so they match the new major version.

---

Nitpick comments:
In `@charts/templates/configmap-dashboard.yaml`:
- Around line 10-11: Update the dashboard content expression under the
sentinel-metrics.json ConfigMap key to wrap .Files.Get for
dashboards/sentinel-metrics.json with Helm’s required helper, supplying a
descriptive missing-file message so template rendering fails when the file is
absent while preserving the existing nindent formatting.
🪄 Autofix

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: e1bbb2d2-7b8c-4c6c-af01-56a07aba5f38

📥 Commits

Reviewing files that changed from the base of the PR and between 75e95d3 and 5914e44.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • charts/Chart.yaml
  • charts/README.md
  • charts/dashboards/sentinel-metrics.json
  • charts/templates/configmap-dashboard.yaml
  • charts/templates/deployment.yaml
  • charts/templates/servicemonitor.yaml
  • charts/values.schema.json
  • charts/values.yaml
🔗 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 (4)
  • charts/templates/deployment.yaml
  • charts/values.yaml
  • charts/dashboards/sentinel-metrics.json
  • charts/templates/servicemonitor.yaml

Comment thread charts/Chart.yaml
description: HyperFleet Sentinel - Kubernetes service that polls HyperFleet API and publishes CloudEvents
type: application
version: 1.0.0
version: 1.1.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use a major chart version for the breaking values contract.

Line 5 publishes 1.1.0, but this release removes the top-level tracing path and renames monitoring.serviceMonitor.additionalLabels. An upgrade within the 1.x range can silently lose tracing configuration or ServiceMonitor labels. Change the chart version to 2.0.0, then regenerate the version badge and chart documentation.

As per path instructions, charts/** changes affect all deployments and require a Chart.yaml version bump.

🤖 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, Update the chart version in Chart.yaml from
1.1.0 to 2.0.0 to reflect the breaking values contract, then regenerate the
associated version badge and chart documentation so they match the new major
version.

Source: Path instructions

@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

🤖 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/deployment.md`:
- Around line 62-66: Update all tracing-related command examples in
docs/deployment.md, especially the examples near the tracing configuration table
and the later tracing examples, to use the monitoring.tracing.* key prefix
instead of tracing.*. Keep the existing option names and example values
unchanged.
🪄 Autofix

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: 3f3d4610-3545-4e80-99a5-83bc70c18fff

📥 Commits

Reviewing files that changed from the base of the PR and between 5914e44 and d89d444.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • charts/Chart.yaml
  • charts/README.md
  • charts/dashboards/sentinel-metrics.json
  • charts/templates/configmap-dashboard.yaml
  • charts/templates/deployment.yaml
  • charts/templates/servicemonitor.yaml
  • charts/values.schema.json
  • charts/values.yaml
  • docs/deployment.md
  • docs/metrics.md
  • docs/runbook.md
  • docs/sentinel-for-gke-dev.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 (8)
  • charts/templates/deployment.yaml
  • CHANGELOG.md
  • charts/Chart.yaml
  • charts/templates/servicemonitor.yaml
  • charts/values.yaml
  • charts/README.md
  • charts/values.schema.json
  • charts/dashboards/sentinel-metrics.json

Comment thread docs/deployment.md
@Ruclo
Ruclo force-pushed the HYPERFLEET-1363 branch from d89d444 to 9fc0189 Compare August 4, 2026 14:15
@Ruclo

Ruclo commented Aug 4, 2026

Copy link
Copy Markdown
Author

/retest

…ng section

Consolidate all observability configuration under a single monitoring:
section for consistency across HyperFleet charts.

- Move tracing from top-level to monitoring.tracing
- Move dashboard JSON from deployments/dashboards/ to charts/dashboards/
- Add configmap-dashboard.yaml for Grafana sidecar provisioning
- Rename serviceMonitor additionalLabels to labels
- Simplify honorLabels handling (remove hasKey guard)
- Default sampler to parentbased_always_on
@Ruclo
Ruclo force-pushed the HYPERFLEET-1363 branch from 9fc0189 to 027125c Compare August 5, 2026 10:32
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@Ruclo

Ruclo commented Aug 5, 2026

Copy link
Copy Markdown
Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant