Integrating Alertmanager with Grafana OnCall
Introduction
Grafana OnCall is an incident management system that complements Prometheus Alertmanager by providing advanced on-call scheduling, escalation policies, and collaborative incident response. Integrating Alertmanager with Grafana OnCall helps centralize alert management and streamline response workflows.
Why Integrate Alertmanager with Grafana OnCall?
- Centralized alert routing and management
- Improved on-call scheduling and escalation
- Seamless incident tracking and collaboration
- Customizable notification channels beyond Alertmanager’s defaults
Prerequisites
- Running Prometheus with Alertmanager configured
- Grafana OnCall installed and accessible
- Basic knowledge of Alertmanager routing and receivers
Configuring Alertmanager to Forward Alerts to Grafana OnCall
Grafana OnCall supports receiving alerts via webhook. You need to add a webhook receiver in alertmanager.yml:
receivers:
- name: 'grafana-oncall-webhook'
webhook_configs:
- url: 'https://your-grafana-oncall-domain/api/webhook/alertmanager'
Replace https://your-grafana-oncall-domain/api/webhook/alertmanager with your actual Grafana OnCall webhook URL.
Routing Alerts to the Grafana OnCall Receiver
Set up routing rules to send specific alerts to the webhook receiver:
route:
receiver: 'grafana-oncall-webhook'
group_by: ['alertname', 'severity']
group_wait: 30s
group_interval: 5m
repeat_interval: 3h
Testing the Integration
Trigger a test alert from Prometheus or use Alertmanager’s API to send a sample alert. Verify that the alert appears in Grafana OnCall under incidents or alerts.
Benefits of This Integration
- Alerts are automatically tracked as incidents in Grafana OnCall
- On-call schedules and escalation policies are enforced
- Notifications can be customized and sent via multiple channels (SMS, email, Slack, etc.)
- Enhanced collaboration with team notes and incident timelines
Conclusion
Integrating Alertmanager with Grafana OnCall provides a powerful combination for monitoring and incident management. This setup improves alert handling efficiency and ensures timely responses by leveraging advanced on-call scheduling and escalation features.