Hi
Is it possible to import and export alerting?
including:
alert rules
contact points
notification policies
Hello,
yes it is possible, check this: Alerting Provisioning HTTP API | Grafana documentation
Thanks for your reply
- Is there no option to import/export by the gui?
- Az I understand I can export all alerts to a file by for example:
curl /api/v1/provisioning/alert-rules/export > file
How can I import the file? - For contact points and notification policies - I don’t see an option to export to a file
How can I import the contact points and notification policies
I mean
curl /api/v1/provisioning/alert-rules/export > file
Yes it is possible to export an alert to a file.
It is possible to import an alert from a file.
It is not possible to import several alerts in one go.
It is not simple to provisioning with bash. It’s better to use Python or Terraform.
Keep in mind that if an alert is provisioned, it can’t be modified via the UI.
I would love to try the script
Thanks!
I created a bash script to copy the alerts of one grafana instance to another. It’s very rough and I’m new to scripting, but here is a link if you want to check it out: GitHub - danielkim4565/grafana-scripts
Feel free to suggest improvements or ask for more details if you’re interested in this script!