在Alertmanager中添加自定义Webhook配置

时间:2019-04-22 10:07:27

标签: prometheus prometheus-alertmanager prometheus-operator

我有一个自定义的Webhook URL,我需要在alertmanager中对其进行配置,以获取警报通知。但是我的配置无法正常工作。在alertmanager中出现以下错误,

level=error ts=2019-04-22T09:31:46.038681545Z caller=dispatch.go:279 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="cancelling notify retry for \"webhook\" due to unrecoverable error: unexpected status code 404 from http://example.com:9898/TrigerToSlack"

我的Alertmanager配置如下,

route:

  group_by: ['job']

  group_wait: 1s

  group_interval: 5m

  repeat_interval: 12h

  receiver: webhook

  routes:
  - receiver: webhook
    continue: true  
receivers:
    - name: webhook
      webhook_configs:
      - url: 'webhook URL'
        send_resolved: true````

1 个答案:

答案 0 :(得分:0)

我已解决此问题。我的API调用是POST,但我已将其定义为GET。将GET更改为POST,之后一切正常。