route:
  receiver: email-self

  group_by: [ alertname, service ]

  group_wait: 30s
  group_interval: 5m
  repeat_interval: 3h

  routes:
  - matchers:
    - service="infrastructure"
    receiver: email-self
    routes:
    - matchers:
      - severity="critical"
      receiver: 'pushover-self'

  - matchers:
    - service="backend"
    receiver: email-self
    routes:
    - matchers:
      - severity="critical"
      receiver: 'pushover-self'

  - matchers:
    - service="frontend"
    receiver: email-self
    routes:
    - matchers:
      - severity="critical"
      receiver: 'pushover-self'

inhibit_rules:
- source_matchers: [ severity="critical" ]
  target_matchers: [ severity="warning" ]
  equal: [ alertname, service ]

receivers:
  - name: pushover-self
    pushover_configs:
      - token: agy1n4b4p8chrgatsusxxub2se9x7q
        user_key: u15he1cutrs9szvdz48tgypgachkh5

  - name: email-self
    email_configs:
      - to: alexanderlebens@gmail.com
        from: alexanderlebens@gmail.com
        smarthost: smtp.gmail.com:587
        auth_username: "alexanderlebens@gmail.com"
        auth_identity: "alexanderlebens@gmail.com"
        auth_password: "rcqzctyvzzctoesz"
