canonical / grafana-k8s-operator

This charmed operator automates the operational procedures of running Grafana, an open-source visualization toolkit, on Kubernetes.
https://charmhub.io/grafana-k8s
Apache License 2.0
6 stars 23 forks source link

Allow integration from multiple instances of the same charm without overwriting the first dashboard created #310

Closed amandahla closed 3 days ago

amandahla commented 4 months ago

Enhancement Proposal

I would like to integrate multiple instances of the same charm with Grafana, creating one dashboard for each integration.

Reason: deploy and integrate different versions of the charm so will not be the same dashboard for every instance integrated.

Reference: https://matrix.to/#/!nHXpRkcSNJHlHdUGbQ:ubuntu.com/$8c6wHO28xRmdBwrGwzndugr1SZWPupyIIk3F1ebUK_I?via=ubuntu.com&via=matrix.org

sed-i commented 4 months ago

Currently, dashboards are intentionally named on disk this way to avoid duplicates:

$ juju ssh --container grafana grafana/0 ls -1 /etc/grafana/provisioning/dashboards 
default.yaml
juju_alertmanager-k8s_e9224b0.json
juju_loki-k8s_0804127.json
juju_prometheus-k8s_35dd368.json
self_dashboard.json

So if you're changing the contents of the dashboard, its sha256 would change and the dashboards won't overwrite each other.

One way of forcing it is modifying the dashboard's uid.

But I'm not clear on the use case. Why would you want to do that? The means of differentiating one instance from another is via the dashboard dropdowns.

amandahla commented 3 months ago

So, by changing the content, would I have two different dashboards with the same title then?

chanchiwai-ray commented 3 months ago

I think the active provisioning system in Grafana don't like the dashboards with the same title: see issue #303

lucabello commented 3 days ago

Closing because I believe this is solved via the suggestions above; please feel free to reopen if this is still an issue!