We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.
There are several predefined alerts in the monitoring dashboards. When an alert changes state, it sends out notifications. In order to receive alerts from Grafana, you need to configure a notification channel.
Grafana supports various notification types (email, Slack, Webhooks, etc.). Please check out Grafana's documentation for more notification type supports.
This document covers setting up common notification channels such as: email, Slack, PagerDuty, and Webhooks.
Before setting up a notification, make sure your monitoring containers are up and running.
monitoring-compose.yml
file.
services: ... grafana: ... environment: GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:?Missing env GF_SECURITY_ADMIN_PASSWORD for Grafana admin password} WA_PROMETHEUS_ENDPOINT: ${WA_PROMETHEUS_ENDPOINT:-http://prometheus:9090} GF_SERVER_ROOT_URL: your-grafana-public-endpoint #(ex. https://foo.bar.com:3000) GF_SMTP_ENABLED: 1 GF_SMTP_HOST: your-smtp-host #(ex. smtp.gmail.com:465) GF_SMTP_USER: your-smtp-auth-user #(ex. you@email.com) GF_SMTP_PASSWORD: your-smtp-auth-password GF_SMTP_SKIP_VERIFY: 1 depends_on: - 'prometheus'
docker-compose -f monitoring-compose.yml up -d
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
) to set up the Slack notification in Grafana. Test your setup by clicking the Send Test button. If it's configure correctly, you should receive a message on configured channel like this:
de7439f367354513b9e1ba4042f0e3b8
) to set up a PagerDuty notification in Grafana. Test your set up by clicking the Send Test button. If it's configured correctly, you should receive an alert on the PagerDuty Alerts Page like this:
You could also set up a Webhook server to receive alerts.
{ "evalMatches": [ { "metric": "High value", "tags": null, "value": 100 }, { "metric": "Higher Value", "tags": null, "value": 200 } ], "message": "Someone is testing the alert notification within grafana.", "ruleId": 0, "ruleName": "Test notification", "ruleUrl": "http://localhost:3000/", "state": "alerting", "title": "[Alerting] Test notification" }If not, check your Grafana container logs to debug.