Menu
Grafana Cloud Enterprise Open source

Export alerting resources

Export your alerting resources, such as alert rules, contact points, and notification policies for provisioning, automatically importing single folders and single groups.

The export options listed below enable you to download resources in YAML, JSON, or Terraform format, facilitating their provisioning through configuration files or Terraform.

Export alert rules

To export alert rules from the Grafana UI, complete the following steps.

  1. Click Alerts & IRM -> Alert rules.

  2. To export all Grafana-managed rules, click Export rules.

  3. To export a folder, change the View as to List.

  4. Select the folder you want to export and click the Export rules folder icon.

  5. To export a group, change the View as to Grouped.

  6. Find the group you want to export and click the Export rule group icon.

  7. Choose the format to export in.

    The exported rule data appears in different formats - YAML, JSON, Terraform.

  8. Click Copy Code or Download.

    a. Choose Copy Code to go to an existing file and paste in the code.

    b. Choose Download to download a file with the exported data.

Modify and export alert rules without saving changes

Use the Modify export mode to edit and export an alert rule without updating it.

Note

This feature is for Grafana-managed alert rules only. It is available to Admin, Viewer, and Editor roles.

To export a modified alert rule without saving the modifications, complete the following steps from the Grafana UI.

  1. Click Alerts & IRM -> Alert rules.

  2. Locate the alert rule you want to edit and click More -> Modify Export to open the Alert Rule form.

  3. From the Alert Rule form, edit the fields you want to change. Changes made are not applied to the alert rule.

  4. Click Export.

  5. Choose the format to export in.

    The exported rule data appears in different formats - YAML, JSON, Terraform.

  6. Click Copy Code or Download.

    a. Choose Copy Code to go to an existing file and paste in the code.

    b. Choose Download to download a file with the exported data.

Export API endpoints

You can also use the Alerting provisioning HTTP API to export alerting resources in YAML or JSON formats for provisioning.

Note that most Alerting endpoints return a JSON format that is not compatible for provisioning via configuration files, except the ones listed below.

MethodURISummary
GET/api/v1/provisioning/alert-rules/:uid/exportExport an alert rule in provisioning file format.
GET/api/v1/provisioning/folder/:folderUid/rule-groups/:group/exportExport an alert rule group in provisioning file format.
GET/api/v1/provisioning/alert-rules/exportExport all alert rules in provisioning file format.
GET/api/v1/provisioning/contact-points/exportExport all contact points in provisioning file format.
GET/api/v1/provisioning/policies/exportExport the notification policy tree in provisioning file format.

These endpoints accept a download parameter to download a file containing the exported resources.