grafana-util docs

grafana-util alert diff

What this page covers

Compare local alerting export files against live Grafana resources.

When to open this page

  • Check a raw export directory against Grafana before import or plan work.
  • Render the diff as plain text or structured JSON.

Who this page is for

Best for operators who review alert rules, routes, contact points, and staged alert changes.

Purpose

Compare local alerting export files against live Grafana resources.

When to use

  • Check a raw export directory against Grafana before import or plan work.
  • Render the diff as plain text or structured JSON.

Key flags

  • --diff-dir points to the raw export directory.
  • --output-format json renders the diff as structured JSON.
  • --json remains available as a compatibility flag equivalent to --output-format json.
  • --dashboard-uid-map and --panel-id-map repair linked alert rules during comparison.

Examples

# Purpose: Compare local alerting export files against live Grafana resources.
grafana-util alert diff --url http://localhost:3000 --diff-dir ./alerts/raw
# Purpose: Compare local alerting export files against live Grafana resources.
grafana-util alert diff --url http://localhost:3000 --diff-dir ./alerts/raw --output-format json

CLI schema lookup: