Skip to content

fix(roles/grafana_grizzly): move dashboards back into their folder on Grafana 13.1+ - #423

Merged
markuslf merged 1 commit into
mainfrom
fix/grafana-grizzly-folders
Oct 5, 2026
Merged

markuslf merged 1 commit into
mainfrom
fix/grafana-grizzly-folders

Conversation

@markuslf

@markuslf markuslf commented Oct 5, 2026

Copy link
Copy Markdown
Member

On icinga-demo (Grafana 13.2.2), the graphs embedded in IcingaWeb2 failed with "Failed to load dashboard 403" for 18 of the Monitoring Plugins dashboards, among them memory-usage, ping and cpu-usage.

Grafana 13.1 routes /api/dashboards/db into the Kubernetes save path, which sets the folder from folderUid only (saveDashboardViaK8s() in pkg/api/dashboard.go, grafana/grafana#122027). grizzly sends folderId, so every dashboard it adds or updates lands in the root. A dashboard moved there loses the viewer permission it inherited from the folder, while dashboards created in the root get their own; the anonymous viewer that IcingaWeb2 embeds Grafana with then gets 403. No grizzly release sends folderUid.

Changes

  • roles/shared, grafana-move-dashboards-into-folders.yml: takes the dashboards and their folders, reads the current folder of every dashboard with a single /api/search, and saves only the misfiled ones again with folderUid. That puts them back and restores the permission. Dashboards Grafana does not know, and those whose resource names general (the root in grizzly), are left alone.
  • roles/grafana_grizzly, roles/monitoring_plugins_grafana_dashboards: call it after grr apply, with the Dashboard resources parsed from the applied files on the controller.
  • READMEs ("How the Role Behaves") and CHANGELOG.

Stopgap until the switch to gcx (Linuxfabrik/monitoring-plugins#1062).

Tests

  • icinga-demo, setup_icinga2_master --tags monitoring_plugins_grafana_dashboards: with swap-usage changed in Grafana beforehand, grr reported Dashboard.swap-usage updated and filed it in the root, the new task moved it back. Afterwards no Linuxfabrik dashboard was in the root, swap-usage answered the anonymous viewer with 200 and carried the content grizzly applied.
  • Same run without drift: nothing saved, --check reads only.
  • Parsing: 188 dashboards with a folder from the Monitoring Plugins; the resources of 001-p-app91 (kind: Dashboard quoted and unquoted, folder: general) are recognised and skipped.
  • ansible-lint on the changed roles: only the four existing findings outside these lines. No Molecule scenario exists for Grafana.

… Grafana 13.1+

Grafana 13.1 routes /api/dashboards/db into the Kubernetes save path,
which sets the folder from folderUid only (grafana/grafana#122027).
grizzly sends folderId, so every dashboard it adds or updates lands in
the root and loses the viewer permission inherited from the folder;
anonymous viewers and the IcingaWeb2 iframes get 403.

After grr apply, grafana_grizzly and monitoring_plugins_grafana_dashboards
now compare the folder of each dashboard resource with /api/search and
save the misfiled ones again with folderUid. "general" means the root
and is skipped. Stopgap until the switch to gcx.

Verified against Grafana 13.2.2 on Rocky 9.
@markuslf
markuslf merged commit bbef9b6 into main Oct 5, 2026
13 checks passed
@markuslf
markuslf deleted the fix/grafana-grizzly-folders branch October 5, 2026 10:04
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.

1 participant