Hello, is it possible to export all alerts of the new Grafana 8 alerts to a json or yml file like all the other dashboards (and use it later in the provision process)? We want to have all our infrastructure as code and therefore want to have everything available in files and not in the Grafana database.
ok, thanks for the quick response. If you find out how to do it, I would be really thankful for a small update/link :-).
My first try will be on use a custom DB and not the interal sqllite3 db where this kind of data is stored.
Yes this sounds like a good solution. But I’ll keep you updated if I find out anything…
And for me this is a must… Hope they will add this in a few versions.
This feature is a must to deploy over multiple stages or production instances. In my case we have multiple kubernetes cluster for production use. And the import feature using a configmap is great. I wish to have this for unified alerts as well.
Hi an export of the alerts is definitely possible, using the API:
curl -X GET -H “Authorization: Bearer TOKEN” -H “Content-type: application/json” ‘http://IP:3000/api/ruler/grafana/api/v1/rules/{Namespace}’ | jq > alerts.json
This outputs a json file with all alerts from the given namespace.
The Problem is importing this data to another grafana instance,
+1 on this and also wondering if there is an update. Since the alerts are still linked and stored in the dashboard jsons (at least before v8, as far as I am aware) but don’t show up in the new alert rules, it seems related to this GitHub issue when upgrading from v8.2 to v8.3. I’m hoping the fix for this will also involve a separate export possibility for alert rules.