> i am getting 400 status code for webhook

That means you are invoking the webhook wrongly - 400 means bad request 
sent by client. The body of the 400 message probably tells you what you're 
doing wrong.

The JSON body that Alertmanager POSTs is fixed, and defined here:
https://prometheus.io/docs/alerting/latest/configuration/#webhook_config

I am guessing that the webhook receiver that you're sending to needs its 
data in a different format.

If you google for "alertmanager teams" then the first hit is this:
https://medium.com/javarevisited/react-faster-alertmanager-to-teams-fa888bcd7c01

They are using a third-party package called "prom2teams 
<https://github.com/idealista/prom2teams>"  to convert an alertmanager 
webhook into a form that Teams will accept.

On Friday, 24 June 2022 at 05:25:34 UTC+1 [email protected] wrote:

> Hi Team,
>
> i am sending  multiple alerts one is email alert and another is to msteam 
> channel using webhook.
>
> My configuration in alertmanger .yml
>
> route:
>   group_by: ['alertname']
>   group_wait: 30s
>   group_interval: 5m
>   repeat_interval: 1h
>   receiver: 'ms_teams'
>   routes:
>       - receiver: "ms_teams"
>         group_wait: 10s
>         match_re:
>           severity: critical|warning
>         continue: true
>
>       - receiver: "send_email"
>         group_wait: 10s
>         match_re:
>           severity: critical
>         continue: true
>
> receivers:
>   - name: "ms_teams"
>     webhook_configs:
>       - url: 
> 'https://<mycmp>/webhookb2/094e8920-b8d3-49ee-a7d4-8576b636ecbb@44b79a67-d972-49ba-9167-8eb05f754a1a/IncomingWebhook/76c301af46724afcb5d27366adc7e31e/71493bd4-0176-499c-bc34-1064b9e3e72e'
>         send_resolved: true
>             
>   - name: "send_email"
>     email_configs:
>       - to: <my cmp email id>
>         from : <sample email id>
>         smarthost: <my smtp config>
>         require_tls: false
>         send_resolved: true
>
> if  i test the email individual i am getting email alert but when i 
> include with the   webhook is not working and i am getting 400 status code 
> for webhook and it is impacting the email alert too.
>
>  FYI.. i tested this webhook from Grafana notification channel, it's 
> working and able to get the alerts to  msteams.
>
> Please check the above config and let me know if i miss any thing.
>
> Regards,
> Venkat
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/5906d4b8-bdae-4f56-8fc3-db8a06a47ecfn%40googlegroups.com.

Reply via email to