Dashboards not updated when the providing charm is upgraded

Bug #1875691 reported by Ryan Farrell
8
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

description: updated
Revision history for this message
Ryan Farrell (whereisrysmind) wrote :

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-dashboardjson

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/

Revision history for this message
Ryan Farrell (whereisrysmind) wrote :

EDIT: I should say "dashboard source" rather than "data source" to avoid confusion with the data represented in the dashboards.

Alvaro Uria (aluria)
Changed in charm-grafana:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Ryan Farrell (whereisrysmind)
Revision history for this message
Ryan Farrell (whereisrysmind) wrote :

Merge Proposal, which partially fixes this bug:
https://code.launchpad.net/~whereisrysmind/+git/charm-grafana/+merge/383170

I've tested the above changes for 3 cases:

* Using the charm's run-action for import-dashboard works as expected now properly updating and uploading new dashboards.

* Changes to the Grafana charm's built in dashboard templates also works as expected.

* Changes to a dashboard in charm that provides it via the dashboards relation still do not appear to appear to trigger an update within grafana. - This may either be due to those charms or due to the interface-grafana layer. Its still under investigation.

Revision history for this message
Ryan Farrell (whereisrysmind) wrote :

Even with a fixed version of the grafana charm which can properly update dashboards, my test model, which is using the kubernetes-master charm as a provider of the dashboard relation, does not update the Dashboard when I upgrade my version of the charm to one with a modified dashboard template.

This may be a bug in the dashboard interface or even the charms.reactive library such that once the relation has been established between the grafana and kubernetes, changes to an existing request are not registered as a new_request.

George Kraft (cynerva)
Changed in charm-kubernetes-master:
status: New → Confirmed
George Kraft (cynerva)
Changed in charm-kubernetes-master:
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Ryan Farrell (whereisrysmind) wrote :

I have a proposed fix for the issue - no changes required in either the interface or providing charms.

MP: https://code.launchpad.net/~whereisrysmind/+git/charm-grafana/+merge/383170

Revision history for this message
George Kraft (cynerva) wrote :

Removing charm-kubernetes-master based on comment #5. Thanks.

no longer affects: charm-kubernetes-master
Alvaro Uria (aluria)
Changed in charm-grafana:
milestone: none → 20.08
status: Confirmed → Fix Committed
Linda Guo (lihuiguo)
Changed in charm-grafana:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.