You haven't said what you've configured as the receiver (target) of the 
webhook.

Whatever it is, it is responding with a 400 error, which means that the 
request being sent is invalid.

The format of the webhook payload sent by Alertmanager is *fixed*.  For an 
example see:
https://prometheus.io/docs/alerting/latest/configuration/#webhook_config

This will be different to what a "Discord webhook tester" sends.

Therefore, if you're pointing the Prometheus alertmanager webhook receiver 
*directly* at a Discord API, it definitely won't work. You will need some 
middleware to translate the Alertmanager webhook payload into something the 
target API understands.  Google "alertmanager discord" for some options.

As for sending to slack, you should use the Alertmanager built-in slack 
integration, not webhook:
https://prometheus.io/docs/alerting/latest/configuration/#slack_config

You can of course make one alertmanager receiver which does both, which is 
perhaps what you're already doing:

receivers:
- name: discord/slack
  slack_configs:
    - ...
  webhook_configs:
    - ...

On Tuesday, 30 August 2022 at 08:03:42 UTC+1 [email protected] wrote:

> Hi Everyone,
>
> Seeking some help here - very new to Prometheus/Alert Manager, must add.
>
> - I set up the kube-prometheus-stack as per: 
> https://github.com/fabricesemti80/home-stack/blob/42f23c6e62184b037908e84d52776a717889ff20/cluster/apps/monitoring/kube-prometheus-stack/helmrelease.yaml#L81
>
> - log errors are similar to this: 
>
> ts=2022-08-30T06:50:59.456Z caller=dispatch.go:354 level=error 
> component=dispatcher msg="Notify for alerts failed" num_alerts=3 
> err="discord/slack[0]: notify retry canceled due to unrecoverable error 
> after 1 attempts: channel \"#prometheus\": unexpected status code 400: 
> {\"attachments\": [\"0\"]}"
>
> - I used this site <https://disforge.com/tool/webhook-tester> to test the 
> webhook
>
> - the test - with the same parameters used in the manifest - was 
> successful (see attached screenshot), therefore I think my settings are 
> correct.
>
> Any suggestions what am I missing please?
>
> Thanks,
> F.
>

-- 
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/e7f7f14f-514f-474c-8052-5bae2c0a6a64n%40googlegroups.com.

Reply via email to