在Prometheus Alertmanager上设置MicrosoftTeams通知

时间:2019-06-05 10:08:19

标签: kubernetes grafana prometheus microsoft-teams prometheus-alertmanager

我尝试为Prometheus Alertmanager设置Microsoft Teams通知,但是通知没有到达。

alertmanager.yaml文件为:

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: []

规则'QuotaCPUSolrExcedeed'存在并且在Prometheus上有效。

如果我将webhook_url放在Grafana上,则通知会到达,但是如果我使用alertmanager,则不会!

您知道可能是什么问题吗?

1 个答案:

答案 0 :(得分:0)

Prometheus AlertManager Web挂钩是generic one。为了将消息转换为MS团队接受的格式,您需要使用辅助车。如官方prom2teams中所述,选项doc之一。