diff --git a/monitoring/alertmanager/alertmanager.yml b/monitoring/alertmanager/alertmanager.yml new file mode 100644 index 0000000..54c2b1c --- /dev/null +++ b/monitoring/alertmanager/alertmanager.yml @@ -0,0 +1,124 @@ +global: + resolve_timeout: 5m + # Slack webhook URL (replace with actual webhook) + slack_api_url: 'https://hooks.slack.com/services/YOUR/WEBHOOK/URL' + +# Templates for alert notifications +templates: + - '/etc/alertmanager/templates/*.tmpl' + +# Route configuration +route: + group_by: ['alertname', 'severity', 'service'] + group_wait: 10s + group_interval: 10s + repeat_interval: 12h + receiver: 'default' + + routes: + # Critical alerts go to critical receiver + - match: + severity: critical + receiver: 'critical' + continue: false + + # Warning alerts go to warning receiver + - match: + severity: warning + receiver: 'warning' + continue: false + + # Info alerts go to info receiver + - match: + severity: info + receiver: 'info' + continue: false + +# Receivers configuration +receivers: + - name: 'default' + slack_configs: + - channel: '#telecom-platform-alerts' + send_resolved: true + title: '{{ .GroupLabels.alertname }}' + text: >- + {{ range .Alerts }} + Alert: {{ .Labels.alertname }} + Severity: {{ .Labels.severity }} + Service: {{ .Labels.service }} + Description: {{ .Annotations.description }} + {{ end }} + + - name: 'critical' + slack_configs: + - channel: '#telecom-platform-critical' + send_resolved: true + title: 'đ¨ CRITICAL: {{ .GroupLabels.alertname }}' + color: 'danger' + text: >- + {{ range .Alerts }} + Alert: {{ .Labels.alertname }} + Severity: {{ .Labels.severity }} + Service: {{ .Labels.service }} + Description: {{ .Annotations.description }} + {{ end }} + # Email configuration for critical alerts + email_configs: + - to: 'oncall@telecom-platform.com' + from: 'alertmanager@telecom-platform.com' + headers: + Subject: 'đ¨ CRITICAL: {{ .GroupLabels.alertname }}' + html: >- + {{ range .Alerts }} +
Severity: {{ .Labels.severity }}
+Service: {{ .Labels.service }}
+Description: {{ .Annotations.description }}
+