1

I have prometheus , nginx-vts , php and nginx-vts-exporter all in separated containers i'm trying to get metrics to prometheus from the exporter ,, it keeps telling me Get http://127.0.0.1:9913/metrics: dial tcp 127.0.0.1:9913: connect: connection refused

this is the error

this is my prometheus.yml

global:

scrape_interval: 15s

evaluation_interval: 15s

scrape_configs:

  • job_name: nginx

    static_configs:

    • targets: ['127.0.0.1:9913']

this is an error from the exporter when i run the compose file

fetchHTTP failed Get http://localhost/status/format/json: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Tyr_90
  • 11
  • 1
  • 1
  • 3
  • There are different ways to wire the connection between your containers. One pretty simple way would be to use [docker-compose](https://docs.docker.com/compose/). Instead of `127.0.0.1` you would reference the containers by names. These would be resolved to IP addresses via DNS. – webwurst Mar 04 '19 at 00:00

1 Answers1

0

When we run Prometheus with Node exporter or any other metrics collecting container, we have to add this in the Prometheus configuration file.

Here, while defining "targets" under "scrape_configs" mention the IP address of the host machine where node exporter is running.

Use "['localhost:9090']" for prometheus and "['host_IP:9100']" for node exporter or any other metrics collecting container.