benjojo / alertmanager-discord

Take your alertmanager alerts, into discord
Apache License 2.0
177 stars 78 forks source link

prometheus cannot make post request to alertmanager #13

Closed EmaLinuxawy closed 3 years ago

EmaLinuxawy commented 3 years ago

Hello, i run the alert manager with docker but I found this in Prometheus logs prometheus[16658]: level=error ts=2021-01-18T20:15:47.759Z caller=notifier.go:524 component=notifier alertmanager=http://localhost:9094/api/v1/alerts count=1 msg="Error sending alert" err="Post http://localhost:9094/api/v1/alerts: EOF"

also I cannot make any get requests to this endpoint : curl http://localhost:9094 curl: (52) Empty reply from server

and this is from container log docker logs alertmanager -f 2021/01/18 20:40:52 Listening on: 0.0.0.0:9094 2021/01/18 20:40:58 http: panic serving 172.22.0.1:34486: unexpected end of JSON input goroutine 6 [running]: net/http.(*conn).serve.func1(0xc000076be0) /usr/local/go/src/net/http/server.go:1801 +0x147 panic(0x6dd060, 0xc00000c2e0) /usr/local/go/src/runtime/panic.go:975 +0x47a main.main.func1(0x79a560, 0xc0000c00e0, 0xc0000b4600) /go/src/mypackage/myapp/main.go:110 +0xd54 net/http.HandlerFunc.ServeHTTP(0xc000010cc0, 0x79a560, 0xc0000c00e0, 0xc0000b4600) /usr/local/go/src/net/http/server.go:2042 +0x44 net/http.serverHandler.ServeHTTP(0xc0000c0000, 0x79a560, 0xc0000c00e0, 0xc0000b4600) /usr/local/go/src/net/http/server.go:2843 +0xa3 net/http.(*conn).serve(0xc000076be0, 0x79ab60, 0xc000074480) /usr/local/go/src/net/http/server.go:1925 +0x8ad created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2969 +0x36c

benjojo commented 3 years ago

You need to run alertmanager to use alertmanager-discord.

This is to say, alertmanager-discord and alertmanager is not interchangeable. you need to configure alertmanager to send alert prompts to alertmanager-discord if that makes sense