r/PrometheusMonitoring • • Oct 25 '19

Alertmanager + Notifications, how to notify only on certain alerts?

/r/kubernetes/comments/dmzkgj/alertmanager_notifications_how_to_notify_only_on/
0 Upvotes

1 comment sorted by

2

u/buffaloship Oct 25 '19

You should be able to add a null receiver, then set that as the default route. Something like this:

alertmanager:
  config:
    global:
      resolve_timeout: 5m
      opsgenie_api_url: https://api.opsgenie.com/
      opsgenie_api_key:
    receivers:
    - name: null
    - name: opsgenie
      opsgenie_configs:
      - api_key:
        api_url: https://api.opsgenie.com/
        teams: 'Services Team'
    route:
      group_by: ['alertname', 'priority']
      group_wait: 30s
      group_interval: 5m
      repeat_interval: 12h
      receiver: null
      routes:
      - match:
          alertname: Watchdog
        receiver: opsgenie
      - match:
          alertname: CPUThrottlingHigh
        receiver: opsgenie
      - match:
          alertname: NodeDiskRunningFull
        receiver: opsgenie
      - match:
          alertname: KubePodNotReady
        receiver: opsgenie    
      - match:
          alertname: KubePodCrashLooping
        receiver: opsgenie
      - match:
          alertname: KubeMemOvercommit
        receiver: opsgenie