Open tporeba opened 1 year ago
It is quite easy to reproduce using grafana docker image + those two json files provided above in the description:
docker run --rm -p 3000:3000 --name grafana grafana/grafana-oss:<version>
grafana image version | old Format | new format |
---|---|---|
6.0.0 | ✅ | ❌ |
7.0.0 | ✅ | ❌ |
8.0.0 | ✅ | ✅ |
9.0.0 | ❌ | ✅ |
9.4.0 | ❌ | ✅ |
I am trying to use grafanalib with grafana 9.4 and I noticed that
grafanalib.core.AlertList
component produces definition of alertlist panel in old json format. The panel gets created, but some properties end up with wrong values and are ignored, for example :stateFilter
oronlyAlertsOnDashboard
.If I understand this note correctly, grafanalib assumes that grafana will migrate from those old json formats to newest formats when dashboard is being imported, but this does not happen for me. I'm not sure if this is some configuration issue or if the new grafana no longer does the migration.
What you expected to happen?
grafanalib.core.AlertList.to_json_data
should produce a json compatible with recent grafana versions.What happened?
For
Grafanalib generates following AlertList a json with AlertList panel, it generates a json like this one:
but after importing this in grafana, panel has default settings in 'Alerts from this dashboard' and 'Alert state filter'.
![image](https://github.com/weaveworks/grafanalib/assets/1500110/e98e418f-0788-48df-9c92-b3f5004792dd)
If following json was generated, the import would work ok:
How to reproduce it?
Generate a dashboard with AlertList panel from grafanalib and install it in grafana
or use one of the following example dashboard jsons for manual test:
steps: 1) In grafana 9.4 import them manually: Dashboards -> Import -> upload json -> Import 2) Go to imported dashboard and click on panel title -> edit -> scroll down to 'Alerts from this dashboard' and 'Alert state filter' options
False
, but should beTrue