I was using grafonnet-lib for generating dashboards and it was working fine with Grafana 8.4.1 in the legacy alerting engine. After upgrading to 9.0.2 generated JSON does not create an alert!
I wonder whether there is any compatibility issue for generating an alert with the lib.
welcome to the forum, @moyamos
grafonnet-lib is is specifically designed to create dashboards. in unified alerting, alerts are not tied to dashboards at all any more - they are their own separate entity, more like a sibling of dashboards.
for provisioning alerts we are actively working on yaml/json support and terraform support, but it’s not complete yet. PRs are actively being made each day toward this, though.
Thanks for your reply @mattabrams.
Is it best practice to rely on and use the grafonnet-lib for creating dashboards in near future?
“grafana as code” matters when it comes to creating many dashboards/panels.
let me try and get my finger on the pulse of dashboards-as-code. We have an initiative, but I know it is a rather complex objective. more soon
Meanwhile, I have adapted my dozen dashboards via “grafonnet-lib”, decoupling alerts. From my experience, the dashboards are generated and imported correctly.
The alerts are set up via scripts with Alert Provisioning: the newest stable API (Alert Provisioning: the newest stable API).
A couple of issues that I have been encountering are as follows:
grafonnet-lib/grafonnet/alertlist.libsonnet does not affect and I have manually trigged it from the “Panel options”.
- Alerts created with the alert provisioning, mentioned above, do not show up with
api/alerts to get the list of all alerts.
Maybe solutions already existed, but I did not yet manage to investigate them.