Skip to content

[monitoring] Fix infra dashboards missing in default variant - #2365

Merged
Andrei Kvapil (kvaps) merged 1 commit into
cozystack:mainfrom
mattia-eleuteri:fix/monitoring-infra-dashboards-default-variant
Apr 9, 2026
Merged

Andrei Kvapil (kvaps) merged 1 commit into
cozystack:mainfrom
mattia-eleuteri:fix/monitoring-infra-dashboards-default-variant

Conversation

@mattia-eleuteri

@mattia-eleuteri mattia-eleuteri commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

  • Adds cozy-monitoring namespace to the infra dashboards rendering condition in dashboards.yaml
  • The default variant deploys the monitoring chart to cozy-monitoring, but the condition from [monitoring] Scope infrastructure dashboards to tenant-root only #2197 only checked for tenant-root, causing all infrastructure dashboards to be missing
  • This is consistent with the existing pattern in vmagent.yaml which already handles both namespaces

Release note

[monitoring] Fix infrastructure dashboards not rendering in default variant where monitoring is deployed to cozy-monitoring namespace

Fixes #2349

Summary by CodeRabbit

  • Infrastructure & Monitoring
    • Expanded Grafana dashboard availability across additional deployment environments for infrastructure monitoring.

The default variant deploys monitoring to the cozy-monitoring namespace,
but the infra dashboards condition only checked for tenant-root. This
adds cozy-monitoring to the condition, consistent with the existing
pattern in vmagent.yaml.

Fixes cozystack#2349

Signed-off-by: mattia-eleuteri <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b47f2c7-4010-4827-a06b-c865f35e10d5

📥 Commits

Reviewing files that changed from the base of the PR and between 04c2f66 and b8d48ad.

📒 Files selected for processing (1)
  • packages/system/monitoring/templates/dashboards.yaml

📝 Walkthrough

Walkthrough

Updated a Helm template conditional to render infrastructure dashboards when .Release.Namespace is tenant-root or cozy-monitoring, instead of only tenant-root. This enables infrastructure dashboards in the default variant deployment.

Changes

Cohort / File(s) Summary
Helm Template Conditional
packages/system/monitoring/templates/dashboards.yaml
Modified namespace check to include both tenant-root and cozy-monitoring, allowing infrastructure dashboards to render in both multi-tenant and default variant deployments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With burrows in two namespaces deep,
Our dashboards now have no secrets to keep,
From tenant-root to cozy-monitoring's glow,
The infrastructure metrics gracefully flow,
A simple or makes the magic complete! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing missing infra dashboards in the default variant by adding the cozy-monitoring namespace condition.
Linked Issues check ✅ Passed The pull request directly addresses the requirement in issue #2349 by adding cozy-monitoring namespace to the infra dashboards rendering condition, enabling them in the default variant.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the infra dashboards rendering condition in dashboards.yaml as specified in issue #2349; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@dosubot dosubot Bot added the kind/bug Categorizes issue or PR as related to a bug label Apr 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the dashboard template to include the cozy-monitoring namespace alongside tenant-root for rendering infrastructure dashboards. The reviewer suggests avoiding hardcoded namespace names in the template logic by making the condition configurable via values.yaml, which would improve the chart's flexibility and maintainability across different environments.

{{- end }}
{{- end }}
{{- if eq .Release.Namespace "tenant-root" }}
{{- if or (eq .Release.Namespace "tenant-root") (eq .Release.Namespace "cozy-monitoring") }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Hardcoding specific namespace names like tenant-root and cozy-monitoring directly in the template logic reduces the flexibility and maintainability of the chart. If the monitoring stack is deployed in a different namespace (e.g., in a custom variant or a production environment with a different naming convention), these infrastructure dashboards will not be rendered. While this approach is consistent with other components like vmagent.yaml, consider making this condition configurable via values.yaml (e.g., by using a boolean flag or a configurable list of namespaces) to better support custom deployment scenarios.

@kvaps Andrei Kvapil (kvaps) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 9, 2026
@kvaps Andrei Kvapil (kvaps) added the kind/backport Categorizes issue or PR as requiring a backport to the current release line label Apr 9, 2026
@kvaps
Andrei Kvapil (kvaps) merged commit 2c6e0fe into cozystack:main Apr 9, 2026
15 checks passed
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

Successfully created backport PR for release-1.2:

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

Labels

kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/bug Categorizes issue or PR as related to a bug lgtm This PR has been approved by a maintainer size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infrastructure Grafana dashboards missing in default variant monitoring

2 participants