Set MicrosoftTeams notification on Prometheus Alertmanager

6/5/2019

I try to set Microsoft Teams notifications for Prometheus Alertmanager, but the notification doesn't arrive.

The alertmanager.yaml file is:

global:
resolve_timeout: 5m
  http_config: {}
  smtp_hello: localhost
  smtp_require_tls: true
  pagerduty_url: https://events.pagerduty.com/v2/enqueue
  hipchat_api_url: https://api.hipchat.com/
  opsgenie_api_url: https://api.opsgenie.com/
  wechat_api_url: https://qyapi.weixin.qq.com/cgi-bin/
  victorops_api_url: https://alert.victorops.com/integrations/generic/20131114/alert/
route:
  receiver: teams
  group_by:
  - alertname
  routes:
  - receiver: teams
    match:
      alertname: QuotaCPUSolrExcedeed
receivers:
- name: teams
  webhook_configs:
  - send_resolved: true
    http_config: {}
    url: https://outlook.office.com/webhook/xxx
templates: []

The rule 'QuotaCPUSolrExcedeed' exist and work on Prometheus.

If I put the webhook_url on Grafana, the notification arrives, but if I use alertmanager, no!

Do you have any idea what the problem might be?

-- Martina Pesca Bellio
grafana
kubernetes
microsoft-teams
prometheus
prometheus-alertmanager

1 Answer

6/5/2019

Prometheus AlertManager web hook is a generic one. In order to transform the message into format, which is accepted by MS teams, you need to use side car. One of the option prom2teams, as it is described in the official doc.

-- Oleg Mayko
Source: StackOverflow