Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alertmanager.url can not be an alias setup in /etc/hosts #141

Closed
casertap opened this issue Oct 28, 2015 · 5 comments
Closed

alertmanager.url can not be an alias setup in /etc/hosts #141

casertap opened this issue Oct 28, 2015 · 5 comments

Comments

@casertap
Copy link

Here is part of my docker-compose.yml

promalertmgr:
  build: promalertmgr/
  container_name: promalertmgr
  ports:
    - "9093:9093"
  expose:
    - "9093"
  command: "-config.file=/alertmanager.conf"
  env_file:
    - './.env'

prometheus:
  build: prometheus/
  container_name: prometheus
  links:
    - cadvisor
    - promalertmgr
    - streamapp
    - dashboardapp
    - analyzeapp
    - mongo
  ports:
    - "9090:9090"
  command: "-config.file=/etc/prometheus/prometheus.yml -alertmanager.url=http://192.168.99.100:9093"
  env_file:
    - './.env'

If I change this:

-alertmanager.url=http://192.168.99.100:9093

into this:

-alertmanager.url=promalertmgr:9093

It does not work anymore.

@casertap
Copy link
Author

the alertmanager.url needs to be a public url. Meaning the url must be outside of the docker private network (it can not stay inside the private network of docker, using an alias will not work).
This can be a problem because the port 9093 is then open to anybody to see...

Someone interested in this issue?

@fabxc
Copy link
Contributor

fabxc commented Jan 3, 2016

As in #164, there's nothing to be done on the Alertmanager side here.

@fabxc fabxc closed this as completed Jan 3, 2016
@brancz
Copy link
Member

brancz commented Oct 13, 2016

@fuzzyami you need to include the protocol scheme in your url. alertmanager:9093 does not, you are likely looking for http://alertmanager:9093.

@fuzzyami
Copy link

fuzzyami commented Oct 13, 2016

@brancz - just figured it out. thanks though!
edit: for future readers - the error I encountered was
unsupported protocol scheme \"alertmanager\""

@AxelMonroyX
Copy link

I get the IP from docker inspect, replace it in a file and then run the prometheus container

docker run --name alert -p 9093 prom/alertmanager

ALERT_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' alertmanagercontainer)
sed -i "s@ALERT_IP@${ALERT_IP}@g" prometheus.yml

docker run -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml -p 9090  --link alert:alert prom/prometheus

and my prometheus.yml looks like

alerting:
  alertmanagers:
  - static_configs:
    - targets:
       - ALERT_IP:9093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants