- docker-compose.monitoring.yml: added alertmanager service (port 9093) - prometheus.yml: alerting config + rule_files entry - alerts.yml: 5 alert rules (PostgreSQLDown, RedisDown, HighDiskUsage, HighMemoryUsage, NodeDown) - alertmanager.yml: SMTP + webhook receiver, inhibit rules
35 lines
861 B
YAML
35 lines
861 B
YAML
global:
|
|
smtp_smarthost: 'localhost:587'
|
|
smtp_from: 'alerts@nexus.local'
|
|
smtp_require_tls: false
|
|
|
|
route:
|
|
group_by: ['alertname', 'severity']
|
|
group_wait: 10s
|
|
group_interval: 10s
|
|
repeat_interval: 1h
|
|
receiver: 'default'
|
|
|
|
receivers:
|
|
- name: 'default'
|
|
email_configs:
|
|
- to: 'admin@nexus.local'
|
|
subject: 'Nexus Alert: {{ .GroupLabels.alertname }}'
|
|
body: |
|
|
{{ range .Alerts }}
|
|
Alert: {{ .Annotations.summary }}
|
|
Description: {{ .Annotations.description }}
|
|
Severity: {{ .Labels.severity }}
|
|
Time: {{ .StartsAt }}
|
|
{{ end }}
|
|
webhook_configs:
|
|
- url: 'http://localhost:5001/pos/api/notifications/webhook'
|
|
send_resolved: true
|
|
|
|
inhibit_rules:
|
|
- source_match:
|
|
severity: 'critical'
|
|
target_match:
|
|
severity: 'warning'
|
|
equal: ['alertname']
|