You showed that you are using the following config:

receivers:
...
- name: 'teams'
  webhook_configs:
    - url: 'https://company.webhook.office.com/webhookb2/XXX'
      send_resolved: true

This means you are attempting to send the alertmanager webhook message 
directly to Microsoft (*.office.com).  You can't do this.  You need to send 
it to your prometheus-msteams process instead, e.g. localhost:2000, and 
*that* will send a message to Microsoft.

There is a valid example 
here: 
https://github.com/prometheus-msteams/prometheus-msteams#static-uri-handler-eg-alertmanager

receivers:
- name: 'prometheus-msteams'
  webhook_configs:
  - send_resolved: true
    url: '*http://localhost:2000/alertmanager*' # the prometheus-msteams 
proxy

On Tuesday, 7 March 2023 at 11:57:11 UTC Kolja Krückmann wrote:

> I am trying to use prometheus-msteams as middleware.
> there I am using my .tmpl earlyer attached. The error sais that it's 
> missing a summary or text. But my tmpl should have that.
>
> any suggestions?
>
> Brian Candler schrieb am Dienstag, 7. März 2023 um 11:29:31 UTC+1:
>
>> On Tuesday, 7 March 2023 at 08:48:37 UTC Kolja Krückmann wrote:
>>
>> I just checked and prom is using the correct yml. I just missed that I 
>> actually changed the alertmanager to localhost:9093 - thats why my error 
>> sais localhost:9093 not 127.0.0.1:9093
>>
>>  
>>
>> Furthermore, I actually don't know why but I just restartet the prom.exe 
>> and the alertmanager.exe and its working fine.
>>
>> localhost:9093 and 127.0.0.1:9093 are different
>>
>> The first connects to any address which maps to "localhost" in your hosts 
>> file, and this includes ::1 (IPv6)
>>
>> 127.0.0.1 *only* connects to 127.0.0.1 (IPv4)
>>  
>>
>>  Another question I had was how to configure the webhook to teams 
>> correctly.
>>
>> You can't simply point a webhook to Teams.  The Alertmanager webhook 
>> sends a fixed format JSON payload, which is not in the format that Teams 
>> expects (as the error says).
>>
>> You'll need some middleware to convert it into something that Teams will 
>> understand, for example:
>> https://github.com/idealista/prom2teams
>>
>> Google for "prometheus alertmanager teams" for more info.
>>
>

-- 
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/f7f3c334-2f73-41a5-9a4b-acc5545597c7n%40googlegroups.com.

Reply via email to