Docker.github.io: Correct Metrics IP in daemon config

Created on 14 Feb 2018  路  2Comments  路  Source: docker/docker.github.io

File: config/thirdparty/prometheus.md, CC @johndmulhausen

The 127.0.0.1 IP in the daemon.config file is not correct, you'd need the eth0 IP of the host for this setup to work since prometheus is running inside a container. In your screen shots you are using 192.168.65.1 or this - that is the IP you'd have to put in the prometheus config file in the target instead of the 'localhost' entry in there now and also in the daemon.json config:

Example: daemon.json file

{
  "metrics-addr" : "192.168.65.1:9323",
  "experimental" : true
}

snippet of the prometheus config to connect to this engine as a target

    static_configs:
      - targets: ['192.168.65.1:9323']
areEngine

Most helpful comment

this is not a proper solution, it doesn't work on a Mac, I've tried to use the local IP address for my network adapter, but it doesn't work. Still getting network refused

the tool should expose a shared ip (or expose localhost address inside the docker image)

Found a way to get local Docker container to talk to localhost, simply add these mappings under

targets:

I recommend to add localhost's IP address in the above targets if you want to see the raw data of the report since the above addresses won't be accessible from the local browser.

see this docker forum link for more info:
https://forums.docker.com/t/accessing-host-machine-from-within-docker-container/14248/20

I hope this helps anyone looking for a solution since I stumbled on this post when looking for the solution.

All 2 comments

this is not a proper solution, it doesn't work on a Mac, I've tried to use the local IP address for my network adapter, but it doesn't work. Still getting network refused

the tool should expose a shared ip (or expose localhost address inside the docker image)

Found a way to get local Docker container to talk to localhost, simply add these mappings under

targets:

I recommend to add localhost's IP address in the above targets if you want to see the raw data of the report since the above addresses won't be accessible from the local browser.

see this docker forum link for more info:
https://forums.docker.com/t/accessing-host-machine-from-within-docker-container/14248/20

I hope this helps anyone looking for a solution since I stumbled on this post when looking for the solution.

Closing this ticket due to its age, and the impending refactor. If you think this is in error, feel free to reopen. Thanks!

Was this page helpful?
0 / 5 - 0 ratings