dashboards_backup script does not work with grafana version >= 8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Grafana Charm |
Fix Released
|
Undecided
|
Mustafa Kemal Gilor |
Bug Description
dashboards_backup script is using a deprecated API to retrieve the dashboard JSON information from Grafana. The used API[1] is deprecated in version 5.4 in favor of using dashboard UID's[2] and removed in version 8.0.
To reproduce the issue, deploy the Grafana charm with APT[3] as follows:
1) Install Grafana charm with APT install method:
juju deploy grafana grafanasnap --series bionic --config install_method=apt
2) Login to Grafana web UI & create a dashboard
3) Schedule automatic dashboard backup job:
juju config grafanasnap dashboards_
4) Retrieve the backup command from the scheduled job:
sudo cat /etc/cron.
5) Run the backup command by hand:
/usr/local/
6) Check dashboard backup files in the backup folder:
/srv/backups/
{"message": "Not found"}
The backup files are supposed to have the dashboard contents. Instead, they have `{"message": "Not found"}` since the API is not present in the deployed Grafana version.
Remedy:
The backup script should use the UID API for Grafana version >= 8.
[1]: https:/
[2]: https:/
[3]: APT package's grafana version is 9.0.6, whereas snap package's grafana version is 7.4.1
Related branches
- Giuseppe Petralia: Approve
- Robert Gildein: Approve
- BootStack Reviewers: Pending requested
-
Diff: 357 lines (+259/-49)6 files modifieddev/null (+0/-46)
src/files/dashboards_backup.py (+86/-0)
src/reactive/grafana.py (+2/-2)
src/templates/juju-dashboards-backup.j2 (+1/-1)
src/tests/unit/test_dashboards_backup.py (+169/-0)
src/tox.ini (+1/-0)
tags: | added: seg sts sts-sponsor |
Changed in charm-grafana: | |
assignee: | nobody → Mustafa Kemal Gilor (mustafakemalgilor) |
status: | New → In Progress |
Changed in charm-grafana: | |
status: | In Progress → Fix Committed |
Changed in charm-grafana: | |
milestone: | none → 22.10 |
Changed in charm-grafana: | |
status: | Fix Committed → Fix Released |
Changed in charm-grafana: | |
status: | Fix Released → Fix Committed |
Changed in charm-grafana: | |
status: | Fix Committed → Fix Released |