capabilities.work

Export Alerting as Code

A 3-step recipe with Grafana. We can help you get access.

Recipe · 3 steps

Export Alerting as Code

with Grafana · Observability Management

Snapshot a Grafana instance's alerting configuration into provisioning YAML.

  1. Export the contact points. Secrets are redacted unless decrypt is set, so the default output is safe to commit to a repository.
  2. Export the notification policy tree. This is the routing that binds alert labels to the contact points exported above, and it is meaningless without them, which is why the two are captured in the same run.
  3. Export the alert rules, optionally scoped to one folder or evaluation group, in provisioning file format.
What you'll need to have ready
  • format: Export format; yaml, json, or hcl.
  • folderUid: Limit the alert rule export to a single folder. Omit to export every rule the caller can see.
  • group: Limit the alert rule export to one evaluation group within the folder. Requires folderUid.
  • decrypt: Include contact point secrets in plaintext. Requires admin permission, and anything exported this way must be treated as a secret — leave it false unless the de
For your developer

Arazzo workflow grafana:export-alerting-as-code, 3 operations: routeGetContactpointsExport → routeGetPolicyTreeExport → routeGetAlertRulesExport. Specs on APIs.io.