aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/namespaces/monitoring/alerts/alertmanager.yaml
blob: 558f208fc9a7c0f3d22247da591d58c41f55aee0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
route:
  group_by: ["alertname", "cluster", "service"]
  receiver: devops-team

  group_wait: 15s

  group_interval: 1m

  routes:
    - receiver: devops-team
      continue: true
    - receiver: pagerduty
      matchers:
        - severity="page"
      continue: true

receivers:
  - name: devops-team
    slack_configs:
      - api_url_file: "/opt/pydis/alertmanager/webhooks/DEVOPS_HOOK"
        send_resolved: true
        title: '{{ if eq .Status "firing" }}[FIRING]{{ else }}[RESOLVED]{{ end }}'
        text: |
          {{ if eq .Status "firing" }}{{ range .Alerts }}
          {{ if .Labels.instance }}`{{ .Labels.instance }}`: {{ end }}**{{ .Annotations.summary }}:**
          {{ .Annotations.description }} [(Link)]({{.GeneratorURL}})

          {{ end }}{{ else }}Alert has resolved.{{ end }}
        fields:
          - title: Alert
            value: "{{ .GroupLabels.alertname }}"
  - name: pagerduty
    pagerduty_configs:
      - routing_key_file: "/opt/pydis/alertmanager/webhooks/PAGERDUTY_KEY"
        url: https://events.pagerduty.com/v2/enqueue