Oh, and since you mentioned that Prometheus is running in a container: each container will have its own network namespace (at least by default), so that it will have its own idea of "localhost" / "127.0.0.1", so it will not be able to connect to the host machine's 9323 under that address. You'll need to provide the host machine's host name or IP and ensure that is reachable.
On Wed, Apr 15, 2020 at 3:11 PM Julius Volz <[email protected]> wrote: > According to https://docs.docker.com/config/daemon/prometheus/ you also > need the '"experimental": true' setting in your daemon.json, do you have > that as well? > > If yes, could you provide more information on the problem? Can you reach > http://127.0.0.1:9323/metrics manually from that host? Note that if you > specify 127.0.0.1 as the IP to listen on, you will not be able to scrape > the endpoint from another host. If you want to make the metrics endpoint > reachable from other hosts, you'll likely want just ":9323" or > "<machine-ip>:9323". > > On Wed, Apr 15, 2020 at 12:41 PM Isabel Noronha <[email protected]> > wrote: > >> Hi, >> I am unable to scrape docker metrics using Prometheus. >> I tried metric addr: "127.0.0.1:9323" in daemon.json file >> >> Note Prometheus is running in a container. >> >> Any help would be appreciated. >> >> Thank you, >> Isabel >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prometheus Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/prometheus-users/227a4767-aed5-497e-9cff-f80f9d9cb884%40googlegroups.com >> <https://groups.google.com/d/msgid/prometheus-users/227a4767-aed5-497e-9cff-f80f9d9cb884%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CA%2BT6YozqgVHcA5B%2BxBdUArJzbzATXUoL18OWNrPbjLk-j_4LmQ%40mail.gmail.com.

