canonical / cos-configuration-k8s-operator

This charmed operator for Kubernetes enables you to provide configurations to various components of the Canonical Observability Stack (COS) bundle.
https://charmhub.io/cos-configuration-k8s
Apache License 2.0
4 stars 6 forks source link

New dropdowns do not work with a cos-config dashboard #27

Closed sed-i closed 1 year ago

sed-i commented 1 year ago

Bug Description

Until recently, a dashboard coming via cos-config was working.

Now, with the new dropdown (or the new grafana 9?), there is a new drop down in which I must choose an application

Screen Shot 2022-10-26 at 12 47 55 PM

As a result, the dashboard no longer works.

Screen Shot 2022-10-26 at 12 44 06 PM

To Reproduce

Deploy the load test and open the sre mock 2 panels - 6 lines and 6 log sources dashboard in grafana.

Environment

COS bundle from edge, on GCP.

Model               Controller  Cloud/Region        Version  SLA          Timestamp
cos-lite-load-test  uk8s        microk8s/localhost  2.9.35   unsupported  09:51:40Z

App            Version  Status  Scale  Charm                         Channel  Rev  Address         Exposed  Message
alertmanager   0.23.0   active      1  alertmanager-k8s              edge      36  10.152.183.254  no       
catalogue               active      1  catalogue-k8s                 edge       4  10.152.183.2    no       
cos-config     3.5.0    active      1  cos-configuration-k8s         edge      11  10.152.183.148  no       
grafana        9.2.1    active      1  grafana-k8s                   edge      52  10.152.183.252  no       
loki           2.4.1    active      1  loki-k8s                      edge      47  10.152.183.111  no       
prometheus     2.33.5   active      1  prometheus-k8s                edge      79  10.152.183.118  no       
scrape-config  n/a      active      1  prometheus-scrape-config-k8s  edge      38  10.152.183.104  no       
scrape-target  n/a      active      1  prometheus-scrape-target-k8s  edge      23  10.152.183.13   no       
traefik                 active      1  traefik-k8s                   edge      93  10.128.0.5      no       

Relevant log output

n/a

Additional context

No response

sed-i commented 1 year ago

Hmm. Looking at https://github.com/canonical/grafana-k8s-operator/pull/116

sed-i commented 1 year ago

@rbarry82 how would you recommend going about inject_dropdowns=False for cos-config? Keep dashboards_path as-is but then, on relation-changed, call add_dashboard(inject_dropdowns=False) for all files? How about adding inject_dropdowns=True to the GrafanaDashboardProvider constructor's kwargs?

rbarry82 commented 1 year ago

It was added to _reinitialize_dashboard_data because that is the explicit backdoor used by cos-config. I would somewhat expect cos_config to add the argument there rather than polluting the constructor with another arg which is only used "globally" by a single charm, maintained by our own team

sed-i commented 1 year ago

Ah yes, _reinitialize_dashboard_data. Thanks!

sed-i commented 1 year ago

@rbarry, shall we publish-lib grafana-dashboard? On charmhub it's LIBPATCH 13 (before inject_dropdowns) vs 16 in main.

rbarry82 commented 1 year ago

I expect that it fell out of sync due to the publish-to-edge action failing. I synced and it's published and up to date as 16 now