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

Update Grafana dashboards on config changed #335

Closed IbraAoad closed 1 month ago

IbraAoad commented 1 month ago

Issue

should close https://github.com/canonical/cos-configuration-k8s-operator/issues/73 once CI picks the automatic lib bump

Solution

Add a config-changed event listener to the lib to update the dashboards.

Testing Instructions

  1. juju deploy --trust grafana-k8s grafana
  2. juju deploy cos-configuration-k8s --config git_repo=https://github.com/canonical/github-runner-operator --config git_branch=main
  3. juju relate cos-configuration-k8s:grafana-dashboards grafana:grafana-dashboard
  4. juju config cos-configuration-k8s grafana_dashboards_path=src/grafana_dashboards
  5. juju show-unit grafana/0 --format json | jq '."grafana/0"."relation-info"'
ca-scribner commented 1 month ago

Minor point but this doesn't fix https://github.com/canonical/cos-configuration-k8s-operator/issues/73 by itself. cos-configuration-k8s-operator also needs a lib bump before https://github.com/canonical/cos-configuration-k8s-operator/issues/73 can close

IbraAoad commented 1 month ago

lgtm, although I suggest addressing this comment before merging

Yeaaah I might have took the automatic lib bump CI for granted here, will fix the pr description