Grafana: Alerting High Availability and Operations
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
Checked on 2026-11-09 against Grafana 13.3.x.
A single Grafana instance that evaluates alert rules is a single point of failure for the thing you rely on to tell you that something else has failed. This page covers what changes when alerting runs in production: how several instances cooperate, how an external Alertmanager can take over notification handling, how an existing Alertmanager configuration can be brought into Grafana, who may do what, and where the limits are. The lab runs one instance and the checks below are written so that they also work with a second one.
It builds on Alerting Architecture (the evaluation-to-notification pipeline), Installation and Configuration (the configuration layers and the shared database for the Grafana HA setup in general) and Users, Teams and Permissions (roles and folder permissions). The Prometheus-side equivalent is in Alertmanager.
How alerting high availability works
Grafana Alerting has two parts that behave differently in a cluster.
-
Evaluation. By default every instance evaluates every rule, so the evaluation work is duplicated once per instance. This is deliberate: alerting keeps working as long as one instance is alive, and no election is needed. The duplicates are visible in the state history (see Monitoring Alerts and State History), which makes them a convenient way to confirm that HA is on.
-
Notification. Each instance has its own embedded Alertmanager. The Alertmanagers share what they have sent over a gossip protocol so that only one of them sends a given notification, on a best-effort basis. The design favours availability over consistency, so in the failure case a duplicate or out-of-order notification is possible and a lost one is not. Silences created on one instance replicate to the others, and notifications and silences are persisted to the database periodically and when an instance shuts down gracefully.
Source: Grafana: Configure high availability.
The load balancer in front of the instances needs no session affinity for the user interface, and the whole group uses one external SQL database (MySQL or PostgreSQL); SQLite is not a basis for an HA deployment (see Installation and Configuration and Grafana: Set up Grafana for high availability).
Configure the gossip cluster
All the settings live in [unified_alerting]. The recommended transport is memberlist, which needs the instances to
reach each other directly on port 9094 over both TCP and UDP.
| Setting | Default | Meaning |
|---|---|---|
|
none |
Comma-separated |
|
|
Address and port this instance listens on for cluster traffic. |
|
none |
Address other members use to reach this instance; set it behind NAT or when the instance has no routable address. |
|
|
How long to wait for an instance to send a notification through its Alertmanager; raise it for distant servers or high latency. |
|
not stated |
Shown only in the Kubernetes example, with the value |
[unified_alerting]
ha_peers = 10.0.0.5:9094,10.0.0.6:9094,10.0.0.7:9094
ha_listen_address = 10.0.0.5:9094
ha_advertise_address = 10.0.0.5:9094
ha_peer_timeout = 15s
A Compose version for two lab instances, using the service names as peers (the GF_ environment form of the same
settings):
services:
grafana-1:
image: grafana/grafana-enterprise:13.3.0
environment:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: postgres:5432
GF_UNIFIED_ALERTING_HA_PEERS: grafana-1:9094,grafana-2:9094
GF_UNIFIED_ALERTING_HA_LISTEN_ADDRESS: 0.0.0.0:9094
GF_UNIFIED_ALERTING_HA_ADVERTISE_ADDRESS: grafana-1:9094
grafana-2:
image: grafana/grafana-enterprise:13.3.0
environment:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: postgres:5432
GF_UNIFIED_ALERTING_HA_PEERS: grafana-1:9094,grafana-2:9094
GF_UNIFIED_ALERTING_HA_LISTEN_ADDRESS: 0.0.0.0:9094
GF_UNIFIED_ALERTING_HA_ADVERTISE_ADDRESS: grafana-2:9094
The environment-variable form follows the GF_<SECTION>_<KEY> rule of
Grafana: Configure a Grafana Docker image. The
database settings and the database user are the ones from the installation page.
Reference: Grafana: Configure high availability (settings and ports).
Redis instead of memberlist
Use Redis only when the instances cannot talk to each other directly, for example when TCP or UDP ports are blocked. Standalone, Cluster and Sentinel modes are supported; the server, and any proxy in front of it, must support pub/sub.
[unified_alerting]
ha_redis_address = redis:6379
ha_redis_prefix = grafana-prod
# Cluster or Sentinel: ha_redis_cluster_mode_enabled, ha_redis_sentinel_mode_enabled,
# ha_redis_sentinel_master_name, plus ha_redis_username / ha_redis_password,
# ha_redis_sentinel_username / ha_redis_sentinel_password and ha_redis_tls_*
ha_redis_prefix should be unique when one Redis serves several Grafana deployments. When an instance has no RFC 6890
address with a default route (typical in containers), set ha_advertise_address to the pod address, for example
"${POD_IP}:9094".
Reference: Grafana: Configure high availability (section on Redis).
Kubernetes
On Kubernetes the peers are the pod addresses, so ha_peers points at a headless service (clusterIP: None) on port
9094, the container exposes 9094 for both TCP and UDP, and the pod IP is passed through the downward API:
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
[unified_alerting]
enabled = true
ha_listen_address = "${POD_IP}:9094"
ha_peers = "grafana-alerting.grafana:9094"
ha_advertise_address = "${POD_IP}:9094"
ha_peer_timeout = 15s
ha_reconnect_timeout = 2m
See Kubernetes Observability for the cluster side.
Reference: Grafana: Configure high availability (section on Kubernetes).
Single-node evaluation mode
Duplicated evaluation multiplies the query load on every data source by the number of instances. The single-node evaluation mode makes only one instance, the primary at cluster position 0, evaluate the rules, and the primary broadcasts the alerts it fires to the others. If it fails, another instance takes over after a short evaluation gap, and the existing alert states remain in the database. It needs memberlist or Redis clustering and the documentation states no maturity level for it.
[unified_alerting]
ha_single_node_evaluation = true
ha_single_evaluation_alert_broadcast_queue_size = 500
The queue size defaults to 200; increase it if the drop metrics show message loss with many rules.
Reference: Grafana: Configure high availability (single-node evaluation).
Verify that the cluster formed
The cluster metrics are on /metrics and are not collected automatically; scrape Grafana as shown in
Monitoring Alerts and State History.
| Metric | Healthy value |
|---|---|
|
The number of instances, identical on all of them. |
|
Peers numbered sequentially from zero. |
|
Not increasing. |
|
Non-primary instances receive alerts through the broadcast. |
|
The same on every instance. |
From Grafana 12.4 these metrics carry the grafana_ prefix, so dashboards and alerts written for older versions must be
updated on upgrade. To avoid duplicate notifications completely, point all Grafana instances at a shared external
Alertmanager (next section) instead of relying on the embedded ones.
Source: Grafana: Configure high availability (verifying the setup).
External Alertmanagers
Grafana evaluates rules and sends firing and resolved alerts to an Alertmanager, which does the notification work. The built-in Grafana Alertmanager is the default and handles only Grafana-managed alerts; external Alertmanagers (Prometheus Alertmanager, Mimir or Cortex) can be used instead of it or beside it. There are two ways to use one, and they can be combined with the built-in one.
-
Forward all alerts. Add the Alertmanager as a data source (Connections > Data sources > Alertmanager), choose the implementation (Mimir, Cortex or Prometheus), give the HTTP URL (for example on port 9093), keep the access mode on Server (the only one that works) and enable Receive Grafana Alerts. Then enable the same thing in Alerts & IRM > Alerting > Settings; an enabled Alertmanager shows "Receiving Grafana-managed alerts".
-
A contact point of type Alertmanager. Only the alerts routed to that contact point, through notification policies or a rule, go to the external system.
Each Alertmanager has its own independent contact points, policies, silences and notifications, which is the main operational cost: a silence created in Grafana does not silence the external one. With a Prometheus Alertmanager, silences can be managed from the Grafana UI but contact points, policies and templates are read-only because its API cannot update them. Amazon Managed Service for Prometheus does not support forwarding Grafana-managed alerts. The Grafana Alertmanager itself only receives Grafana-managed alerts, so external alerts cannot be sent to it, and it keeps the last 100 configuration versions per organization (the oldest is deleted when the limit is exceeded).
In Grafana 13.0 the legacy Alertmanager configuration endpoints were removed or restricted, and
GET /api/alertmanager/grafana/api/v2/status now requires the permission alert.notifications.system-status:read.
Scripts that read the Grafana Alertmanager configuration through those paths need the notifications APIs described in
Provisioning Alerting Resources.
Import an Alertmanager configuration
Public preview in Grafana 13.3 on Cloud, OSS and Enterprise; auto-sync is in private preview. The import brings the receivers, the routing tree, templates, time intervals and inhibition rules of an existing Prometheus or Mimir Alertmanager into Grafana so that routing does not have to be rebuilt by hand. The feature toggles are off by default:
-
alertingImportAlertmanagerAPIenables the API. -
alertingMigrationWizardUIenables the interface (Alert rules > More > Import to Grafana Alerting). -
alerting.syncExternalAlertmanagerenables auto-sync and needs a restart.
[feature_toggles]
alertingImportAlertmanagerAPI = true
alertingMigrationWizardUI = true
The source is a configuration YAML file (optionally with template files) or a Mimir Alertmanager data source; Prometheus Alertmanager data sources are not supported as a source. An import is either staged (kept as a separate, read-only unit combined with your resources at runtime and revertible as a whole) or promoted (merged permanently into editable Grafana resources, with no single-step undo). The source Alertmanager is never modified.
The imported routing tree becomes a named policy tree beside the default one. Alerts reach it only when an alert rule
routes to it by name, so existing notifications do not change on import; the tree name doubles as the import identifier
and must be a valid DNS subdomain name other than default. Receivers keep their Alertmanager fields and run as
Mimir-compatible integrations, so they lack native Grafana features such as images in notifications until the import is
promoted and the contact point rebuilt. Name clashes are resolved by renaming, not overwriting. The documented limits are
Mimir up to 3.0.x and Prometheus Alertmanager up to v0.27, rejection of any *_file or *_ref receiver field, one
staged configuration per organization, and inhibition rules available through the API only. Through the API the
configuration is sent to POST /api/convert/api/v1/alerts, and mimirtool alertmanager load also works.
Alert Advisor
Public preview in Grafana 13.3 for Grafana Cloud and Enterprise (OSS is not listed). Alert Advisor checks
Grafana-managed alert rules against a policy of required annotations (Runbook URL, Summary, Description) and required
label keys (for example team), reports the rules that lack them, and gives a score from 0 to 10, the share of assessed
rules that meet every requirement. New requirements start in detect-only mode; in enforced mode, writes that do not
comply are rejected on the supported provisioning paths (Terraform and the alerting provisioning API, with exceptions
such as the X-Disable-Provenance header or disable_provenance = true), but not writes from the rule editor. It does
not stop existing rules from evaluating, it checks only that a field is present, not that its content is valid, and it
excludes data source-managed and recording rules. Configuring it needs the Admin role or alert.rules.quality:write
with alert.rules:read. For Bookshelf the policy is the runbook, summary, description and team that the provisioned
rules already carry, so enforcement would accept them.
Source: Grafana: Alert rule quality and Grafana: What’s new in 13.3.
Alerting RBAC and roles
Access to alerting is split by resource. In Grafana OSS the basic roles decide: Viewer reads rules and notification resources, Editor writes them, Admin also assigns roles, and No basic role starts with nothing. Folder permissions (View, Edit, Admin) extend a role to the rules and rule-specific silences of a folder and its subfolders, and contact point permissions (View, Edit, Admin) extend or limit access to a single contact point. Folder permissions do not change access to notification resources.
Role-based access control with fixed and custom roles is available in Grafana Enterprise and Grafana Cloud. A permission
is an action plus a scope, and alert rule access always needs three things together: the alerting action, read access to
the folder (folders:read) and, to run queries, datasources:query.
| Resource | Actions (scope) |
|---|---|
Alert rules |
|
External rules (Prometheus, Mimir, Loki) |
|
Instances and silences |
|
Contact points |
|
Notification policies |
|
Mute timings |
|
Templates |
|
Provisioning API |
|
The fixed roles group these actions. fixed:alerting:reader is held by Viewer, fixed:alerting:writer by Editor and
fixed:alerting:admin by Admin, and each is composed of narrower roles for rules, instances and notifications, for
example fixed:alerting.rules:reader and :writer, fixed:alerting.instances:reader and :writer,
fixed:alerting.receivers:creator, :writer and :reader, fixed:alerting.templates:writer,
fixed:alerting.time-intervals:writer and fixed:alerting.routes:writer. For automation, the provisioning roles
fixed:alerting.provisioning:writer (read and write of all alerting resources through the provisioning API without folder
or data source permissions), fixed:alerting.provisioning.secrets:reader and fixed:alerting.provisioning.provenance:writer
are the ones to give to a service account such as the lab ci-provisioner; the Terraform page of the documentation
points to the fixed:alerting.provisioning.* roles for the token it uses. The role-definition table lists further roles
for multiple routing trees, configuration and Alertmanager imports, for example
fixed:alerting.alertmanager-imports:writer, which no basic role holds.
Deprecated permissions (alert.notifications:read and :write, alert.notifications.routes:read and :write,
alert.notifications.receivers:test) remain only for compatibility and are granted to Admins only; replace them in
custom roles with the granular ones above. Since 13.0 the enforcement for custom, Terraform-provisioned and file-provisioned
roles is stricter (see Users, Teams and Permissions).
Performance and limits
Evaluation costs memory, CPU, network and database writes, and four things decide how many rules an instance can carry.
-
Evaluation frequency. Use the longest interval the requirement allows.
-
Result set cardinality. Each series becomes one alert instance, so "errors per path on every VM" multiplies paths by VMs; aggregate to the level that someone can act on (for Bookshelf, per service, not per
uri). -
Query complexity. It matters less than the first two but helps once they are optimised. Alerting queries are often the largest share of a monitoring database’s query load.
-
Database writes. After each evaluation Grafana writes the state of each rule in one update (all instances of the rule in a single protobuf-compressed row of the
alert_instancetable), and the write volume can hurt SQLite.
[unified_alerting]
# with the alertingSaveStatePeriodic feature toggle: save states on a schedule, default 5m
state_periodic_save_interval = 1m
[quota]
# cap results per evaluation; default -1 (unlimited); exceeding it puts the rule in Error
alerting_rule_evaluation_results = 10000
With periodic saving, a crash or a forced kill leaves the database up to the interval stale, so the UI can show wrong
states until re-evaluation and firing alerts can notify again. Since Grafana 13.2 the alertingSaveStateCompressed
toggle and the uncompressed path are removed: if you had disabled the toggle, re-enable it and let one evaluation cycle
run before upgrading, otherwise old uncompressed state is not read and you get a one-time gap in history. The
documentation also notes that Grafana reads and writes rules only in supported Prometheus, Loki, Mimir and
Alertmanager-compatible data sources (the latest two minor versions), and recommends tracking
rate(grafana_alerting_rule_evaluations_total[5m]) against resource use.
What can go wrong
| Symptom | Cause and fix |
|---|---|
Every notification arrives twice |
The instances are not clustered (wrong or empty |
The data source shows N times the alerting query load |
Every instance evaluates; enable single-node evaluation or accept the duplicate load. |
Silences exist on one instance only |
The instances are not in the same cluster, or an external Alertmanager is receiving alerts and has its own silences. |
Rules show Error after a data change |
The |
States look wrong after a restart |
Periodic state saving is on and the previous shutdown was not graceful. |
A script that read the Alertmanager configuration fails after upgrading to 13.x |
The legacy endpoints were removed or restricted in 13.0; use the notifications APIs and grant |
A service account cannot provision |
It lacks |
Verify in the lab
-
Start the second Grafana instance with the Compose snippet above and open
/metricson both. Both must reportgrafana_alertmanager_cluster_members 2and positions 0 and 1. -
Fire the 5xx ratio rule (load generator in failing-request mode). In History, filter by that rule: each state transition appears twice, once per instance, which confirms that both evaluate. The lab webhook receiver gets one notification, not two.
-
Stop
grafana-1while the alert is firing. The receiver keeps getting repeat notifications fromgrafana-2at the policy repeat interval. -
Create a silence on
grafana-1forteam=bookshelf-sreand check that it is listed ongrafana-2within seconds. -
Enable single-node evaluation on both, restart, and confirm in the state history that each transition now appears once.
-
Add a Prometheus Alertmanager data source with Receive Grafana Alerts enabled and compare the Active notifications page for the two Alertmanagers.
In the books
Getting Started with Grafana (McCollam, Apress) describes Grafana high availability as several instances with one shared backend database, requires MySQL or PostgreSQL rather than SQLite and puts a load balancer in front, which is still the basis for the HA deployment. The book says nothing about the Alertmanager gossip cluster, the Redis transport, single-node evaluation or the alerting-specific RBAC roles described on this page.