---

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/route?
  value:
    receiver: critical-receiver
    group_by:
      - alertname
    group_wait: 30s
    group_interval: 1m
    repeat_interval: 1h
    routes:
      - receiver: warning-receiver
        match:
          severity: "warning"
      - receiver: critical-receiver
        match:
          severity: "critical"

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/receivers?/-
  value:
    name: warning-receiver
    email_configs:
      - from: govpaas-alerting-((aws_account))@digital.cabinet-office.gov.uk
        to: govpaas-alerting-((aws_account))+warning@digital.cabinet-office.gov.uk
        headers:
          Subject: "[((metrics_environment))] [warning] {{ .GroupLabels.SortedPairs.Values | join \" \" }}"

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/receivers?/-
  value:
    name: critical-receiver
    email_configs:
      - from: govpaas-alerting-((aws_account))@digital.cabinet-office.gov.uk
        to: govpaas-alerting-((aws_account))+critical@digital.cabinet-office.gov.uk
        headers:
          Subject: "[((metrics_environment))] [critical] {{ .GroupLabels.SortedPairs.Values | join \" \" }}"

---

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/route?
  value:
    receiver: critical-receiver
    group_by:
      - alertname
    group_wait: 30s
    group_interval: 1m
    repeat_interval: 24h
    routes:
      - receiver: warning-receiver
        match:
          severity: "warning"
      - receiver: critical-receiver
        match:
          severity: "critical"

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/receivers?/-
  value:
    name: warning-receiver
    email_configs:
      - from: govpaas-alerting-((aws_account))@digital.cabinet-office.gov.uk
        to: govpaas-alerting-((aws_account))+warning@digital.cabinet-office.gov.uk
        headers:
          Subject: "[((metrics_environment))] [warning] {{ .GroupLabels.SortedPairs.Values | join \" \" }}"

- type: replace
  path: /instance_groups/name=alertmanager/jobs/name=alertmanager/properties/alertmanager/receivers?/-
  value:
    name: critical-receiver
    email_configs:
      - from: govpaas-alerting-((aws_account))@digital.cabinet-office.gov.uk
        to: govpaas-alerting-((aws_account))+critical@digital.cabinet-office.gov.uk
        headers:
          Subject: "[((metrics_environment))] [critical] {{ .GroupLabels.SortedPairs.Values | join \" \" }}"

Change repeat interval to 24h in Alertmanager
Change repeat interval to 24h in Alertmanager

Critical alerts' state should be handled by e.g. PagerDuty and not by
Alertmanager nudging us every hour.

We still set it to 24h as an insurance, although most alerts should be
handled/silenced and not repeated by then.
