Alerts
Configure alerting rules and notifications.
Creating Alerts
- Go to Alerts → Rules
- Click Create Rule
- Configure conditions
- Set notification channels
- Save
Alert Conditions
yaml
# CPU usage above 80% for 5 minutes
- name: High CPU Usage
condition: cpu_percent > 80
duration: 5m
severity: warning
# Service down
- name: Service Down
condition: service_status == "down"
duration: 1m
severity: critical
# Error rate spike
- name: High Error Rate
condition: error_rate > 5
duration: 2m
severity: warningNotification Channels
Slack
yaml
notifications:
slack:
webhook_url: https://hooks.slack.com/services/xxx
channel: "#ops-alerts"
mention_on_critical: "@here"Discord
yaml
notifications:
discord:
webhook_url: https://discord.com/api/webhooks/xxxEmail
yaml
notifications:
email:
smtp_host: smtp.gmail.com
smtp_port: 587
from: alerts@example.com
to:
- oncall@example.comPagerDuty
yaml
notifications:
pagerduty:
integration_key: xxx
severity_mapping:
critical: critical
warning: warningAlert States
| State | Description |
|---|---|
pending | Condition met, waiting for duration |
firing | Alert is active |
resolved | Condition no longer met |
Silencing
Temporarily silence alerts:
bash
# Via UI: Alerts → Silences → Create
# Via API:
curl -X POST /api/v1/alerts/silence \
-d '{"matcher": "service=api", "duration": "2h", "reason": "Planned maintenance"}'