Closed sergiodj closed 4 years ago
This seems to be an issue with Docker compose and/or engine rather than Alertmanager itself. You might want to try running with GODEBUG=netdns=1
(see golang docs).
@simonpasquier, I think it's just an issue with the docker compose file @sergiodj is using. @sergiodj, try to put your services in a dedicated docker network. See here for an example:
https://github.com/trallnag/prometheus-adaptive-cards/tree/master/system-tests/docker-compose
Thanks for the invaluable help, @simonpasquier and @trallnag. As it turns out, the alertmanager image I'm using was changed by one of my colleagues and it was looking at the wrong path for the configuration file. Sorry about the noise; I'm closing the issue now.
This specific string dial tcp 127.0.0.1:5001: connect: connection refused
most likely means failure to mount actual config file. Default config contains a webhook to url: 'http://127.0.0.1:5001/'
. It's nothing about the network.
What did you do?
I'm using the
prom/alertmanager
docker image in order to set up a docker compose here. For now, the compose will contain the alertmanager image, and a very simple test container whose job is just to listen to port 5001 and wait for a webhook call.This is my
alertmanager.yml
:I'm setting up docker-compose using:
According to docker-compose's documentation, the
alertmanager
container should be able to communicate with thetests
container through the internal network just fine.What did you expect to see?
I expected to see the
alertmanager
container sending the webhook calls to thetests
container.What did you see instead? Under which circumstances?
The
alertmanager
container keeps trying to send the webhooks to127.0.0.1
, in spite of the current configuration. Here's what I see in the logs:Environment
I'm using Ubuntu Focal, docker 19.03.8 and docker-compose 1.25.0
Let me know if you need more information about my setup, and I will be glad to provide. Thanks!