docs/sources/datasources/alertmanager/_index.md
Grafana includes built-in support for Alertmanager implementations in Prometheus and Grafana Mimir. After you add an Alertmanager data source, you can use the Choose Alertmanager drop-down in Grafana Alerting to view and manage Alertmanager resources such as silences, contact points, and notification policies. You can also enable the Alertmanager to receive Grafana-managed alerts.
The data source supports the following Alertmanager implementations. You can specify the implementation on the data source's Settings page.
| Implementation | Silences | Contact points | Notification policies | Templates |
|---|---|---|---|---|
| Mimir (default) | Read/write | Read/write | Read/write | Read/write |
| Cortex | Read/write | Read/write | Read/write | Read/write |
| Prometheus | Read/write | Read-only | Read-only | Read-only |
When using the Prometheus implementation, you can manage silences in the Grafana Alerting UI. Contact points, notification policies, and templates are read-only because the Prometheus Alertmanager API does not support write operations for these resources.
To add and configure the Alertmanager data source, complete the following steps:
<!-- vale Grafana.WordList = NO -->{{< docs/shared lookup="alerts/add-alertmanager-ds.md" source="grafana" version="<GRAFANA_VERSION>" >}}
<!-- vale Grafana.WordList = YES -->The data source supports all standard Grafana HTTP authentication methods, including basic auth and TLS. When SigV4 authentication is enabled globally in Grafana, it's also available for this data source.
For more information about authentication options and connection settings, refer to Data source management.
Click Save & test to verify the connection. A successful connection returns Health check passed.
{{< admonition type="note" >}} If you're using the Mimir implementation and Mimir Alertmanager hasn't been configured yet, the health check may still pass. This is expected behavior when Mimir is running in lazy configuration mode. {{< /admonition >}}
You can provision Alertmanager data sources using configuration files or Terraform.
The jsonData fields used across both methods are:
| Field | Description |
|---|---|
implementation | The Alertmanager implementation. Supported values: mimir, cortex, prometheus. Defaults to mimir. |
handleGrafanaManagedAlerts | When true, this Alertmanager receives Grafana-managed alerts. You must also enable alert forwarding in Alerting > Administration in the Grafana UI. |
For more information, refer to Provisioning data sources.
apiVersion: 1
datasources:
- name: Alertmanager
type: alertmanager
url: http://localhost:9093
access: proxy
jsonData:
implementation: prometheus
handleGrafanaManagedAlerts: false
basicAuth: true
basicAuthUser: <USERNAME>
secureJsonData:
basicAuthPassword: <PASSWORD>
To provision the data source with Terraform, use the grafana_data_source resource:
resource "grafana_data_source" "alertmanager" {
name = "Alertmanager"
type = "alertmanager"
url = "http://localhost:9093"
json_data_encoded = jsonencode({
implementation = "prometheus"
handleGrafanaManagedAlerts = false
})
}
For all available configuration options, refer to the Grafana provider data source resource documentation.
This section covers common issues when configuring or using the Alertmanager data source.
Symptoms:
Health check failed.Possible causes and solutions:
| Cause | Solution |
|---|---|
| Incorrect URL | Verify the URL points to your Alertmanager instance and includes the correct protocol, host, and port (for example, http://localhost:9093). |
| Network or firewall issue | Verify that the Grafana server can reach the Alertmanager endpoint. Check firewall rules and DNS resolution. |
| Wrong implementation selected | If you changed the implementation type, re-test the connection. See the implementation mismatch errors below. |
| Incorrect credentials | If basic auth is enabled, verify the username and password are correct. |
Symptoms:
Solution:
The URL you entered is a Mimir or Cortex Alertmanager endpoint, not a Prometheus one. Change Alertmanager Implementation to Mimir or Cortex and click Save & test again.
Symptoms:
Solution:
The URL you entered is a Prometheus Alertmanager endpoint. Change Alertmanager Implementation to Prometheus and click Save & test again.
Symptoms:
Solution:
Enabling Receive Grafana Alerts on the data source alone isn't enough. You must also enable alert forwarding in Alerting > Administration in the Grafana UI. Both settings must be on for Grafana-managed alerts to be forwarded to this Alertmanager.
Symptoms:
Cause:
You're using the Prometheus implementation. The Prometheus Alertmanager API doesn't support write operations for these resources.
Solution:
If you need full read/write access to contact points and notification policies, switch to a Mimir or Cortex Alertmanager and update the Alertmanager Implementation setting.