Skip to content

[kube-prometheus-stack] Allow disabling individual default Grafana dashboards#7015

Open
alien2003 wants to merge 1 commit into
prometheus-community:mainfrom
alien2003:kube-prometheus-stack-disable-default-dashboards
Open

[kube-prometheus-stack] Allow disabling individual default Grafana dashboards#7015
alien2003 wants to merge 1 commit into
prometheus-community:mainfrom
alien2003:kube-prometheus-stack-disable-default-dashboards

Conversation

@alien2003

Copy link
Copy Markdown

Closes #3763

Today the curated Grafana dashboards can only be toggled as a group through grafana.defaultDashboardsEnabled. Dropping a single dashboard means overriding its ConfigMap out of band, which the chart overwrites on the next upgrade.

This adds grafana.defaultDashboardsDisabled, a map keyed by dashboard name (the file name under templates/grafana/dashboards-1.14 without the .yaml suffix). A name set to true stops that dashboard's ConfigMap and its optional GrafanaDashboard CR from rendering while the rest stay:

grafana:
  defaultDashboardsDisabled:
    nodes-darwin: true
    k8s-resources-windows-cluster: true

The default is an empty map, so existing installs render the same dashboards as before. The approach mirrors the existing defaultRules.disabled opt-out for alerts. index is used instead of dot access because dashboard names contain dashes.

The dashboard templates are generated, so the guard clause was added to hack/sync_grafana_dashboards.py and applied to the rendered files; the committed files are identical to the generator output for this change.

How this was tested

  • helm unittest --strict --file 'unittests/**/*.yaml' charts/kube-prometheus-stack (64 tests pass, including a new unittests/grafana/default_dashboards_disabled_test.yaml covering the default render, a disabled dashboard rendering 0 documents, an unrelated dashboard still rendering, and the GrafanaDashboard CR path).
  • Verified each of the 34 generated dashboard guards matches what the updated generator emits.

Backward compatibility

No breaking change. New optional value, default {} preserves current output. Minor version bump 86.2.3 -> 86.3.0.

@alien2003 alien2003 force-pushed the kube-prometheus-stack-disable-default-dashboards branch from 6f96dc4 to 8a76d02 Compare June 22, 2026 19:25
…shboards

The default Grafana dashboards could only be turned on or off as a group
via grafana.defaultDashboardsEnabled. Disabling a single noisy or
irrelevant dashboard meant overriding its ConfigMap out of band, which the
chart overwrites on the next upgrade.

Add grafana.defaultDashboardsDisabled, a map keyed by dashboard name (the
file name under templates/grafana/dashboards-1.14 without the .yaml suffix).
A name set to true drops that dashboard's ConfigMap and its GrafanaDashboard
CR while leaving the rest in place. The default is an empty map, so existing
installs render the same dashboards as before.

The guard is generated, so the clause is added to hack/sync_grafana_dashboards.py
and applied to the rendered templates. This mirrors the existing
defaultRules.disabled opt-out for alerts.

Closes prometheus-community#3763

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: alien2003 <alien2003@protonmail.ch>
@alien2003 alien2003 force-pushed the kube-prometheus-stack-disable-default-dashboards branch from 8a76d02 to 8394757 Compare June 22, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[kube-prometheus-stack] Allow disabling some of the default grafana dashboards

1 participant