prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.57k stars 2.14k forks source link

Help! labels in the receiver's webhook url #2645

Open DgoNascimento opened 3 years ago

DgoNascimento commented 3 years ago

Good morning people, I would like your help to be able to use the information from the alerts to build the webhook URL.

alertmanager, version 0.21.0 (branch: HEAD, revision: 4c6c03ebfe21009c546e4d1e9b92c371d67c021d) build user: root@dee35927357f build date: 20200617-08:54:02 go version: go1.14.4

alertmanager.yml route: group_by: ['...'] receiver: 'Homologacao_receiver' # default/fallback request handler routes:

receivers:

Logs: alertmanager: level=debug ts=2021-07-08T13:32:40.884Z caller=dispatch.go:473 component=dispatcher aggrGroup="{}:{alertname=\"Monitoracao_Processos\", alias=\"\", env=\"Grafana-Kibana-InfluxDB\", group=\"Tools-Homologacao\", instance=\":9100\", job=\"Ambiente-Tools-Homolog\", name=\"telegraf.service\", severity=\"2\", state=\"active\", type=\"simple\"}" msg=flushing alerts=[Monitoracao_Processos[93bf4b8][active]]

alertmanager: level=debug ts=2021-07-08T01:49:11.217Z caller=dispatch.go:473 component=dispatcher aggrGroup="{}/{alias=~\"^(?:)$\",group=~\"^(?:Tools-Homologacao)$\"}:{alertname=\"Monitoracao_Processos\", alias=\"\", env=\"Grafana-Kibana-InfluxDB\", group=\"Tools-Homologacao\", instance=\":9100\", job=\"Ambiente-Tools-Homolog\", name=\"telegraf.service\", severity=\"2\", state=\"active\", type=\"simple\"}" msg=flushing alerts=[Monitoracao_Processos[93bf4b8][active]]

But I get the error: alertmanager: level=error ts=2021-07-08T01:40:30.870Z caller=dispatch.go:309 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="Autohealingnode_receiver/webhook[0]: notify retry canceled after 17 attempts: Post \"http://$labels.alias:9000/hooks/$labels.name\": dial tcp: lookup $labels.alias: no such host"

Would it be possible for me to use information from the alert to build the webhook URL?

Thank you in advance!

DgoNascimento commented 3 years ago

@roidelapluie Would you help me?

nothingclj commented 8 months ago

Have you found a solution to this problem? Would you mind sharing it?