Dashboards not updated when the providing charm is upgraded
Bug #1875691 reported by
Ryan Farrell
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Grafana Charm |
Fix Released
|
Medium
|
Ryan Farrell |
Bug Description
Some charms (such as kubernetes-master) ship a dashboard to Grafana over the "grafana-dashboard" relation.
When the providing charm is updated with changes to the dashboard, those changes do not get reflected on the Grafana UI.
Related branches
~peter-sabaini/charm-grafana:bug/1875691-dashboard-upgrade
- Alvaro Uria (community): Approve
- Giuseppe Petralia: Approve
- Zachary Zehring (community): Needs Fixing
- BootStack Reviewers: Pending requested
-
Diff: 256 lines (+131/-34)6 files modifiedreactive/grafana.py (+40/-15)
tests/functional/tests/bundles/base.yaml (+9/-0)
tests/functional/tests/bundles/overlays/focal-snap.yaml.j2 (+2/-0)
tests/functional/tests/bundles/overlays/focal.yaml.j2 (+2/-0)
tests/functional/tests/test_grafana.py (+76/-19)
tests/functional/tests/tests.yaml (+2/-0)
~peter-sabaini/charm-prometheus-libvirt-exporter:dashboard-fix-upgrade
Merged
into
charm-prometheus-libvirt-exporter:master
at
revision ef35f9d50b9ba5cdc9ecaa50b9f999aa8b2c96ed
- Alvaro Uria (community): Approve
- Zachary Zehring (community): Approve
- Canonical IS Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 316 lines (+44/-80)2 files modifiedfiles/grafana-dashboards/libvirt.json (+28/-76)
reactive/prometheus-libvirt-exporter.py (+16/-4)
~whereisrysmind/charm-grafana:bugs/1875691
Rejected
for merging
into
charm-grafana:master
- Xav Paice (community): Needs Information
- Peter Sabaini (community): Needs Fixing
- Drew Freiberger (community): Approve
- BootStack Reviewers: Pending (mr tracking; do not claim) requested
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 431 lines (+239/-19) (has conflicts)4 files modifiedactions/import-dashboard (+37/-9)
lib/charms/layer/grafana.py (+130/-1)
reactive/grafana.py (+71/-9)
tests/unit/requirements.txt (+1/-0)
description: | updated |
Changed in charm-grafana: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Ryan Farrell (whereisrysmind) |
Changed in charm-kubernetes-master: | |
status: | New → Confirmed |
Changed in charm-kubernetes-master: | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
Changed in charm-grafana: | |
milestone: | none → 20.08 |
status: | Confirmed → Fix Committed |
Changed in charm-grafana: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Based on the Grafana docs [0]; in order to update an existing dashboard via http POST, the data must contain "overwrite": false.
I was able to insert this and successfully test updates to a dashboard by simply using the charm run-action for import-dashboard to exercise the code.
$ juju run-action $grafana-unit import-dashboard location= $unit-path- to-dashboardjso n
Although forcing the overwrite flag to be passed in does work to resolve this bug, there is a broader issue of how updates to the dashboards are handled completely differently for the built in dash templates versus dashboards passed though relations. For the built-in templates the charm is performing an intelligent check on whether the dashboard data has in fact been changed prior to making the POST to grafana. No such check is being performed for the dashboards during the run-action or the dashboard relation. I have a fix in the works which will address this, and ensure that all attempts overwrite dashboard to grafana will be confirmed as necessary regardless of the data source.
[0] https:/ /grafana. com/docs/ grafana/ latest/ http_api/ dashboard/