-
Notifications
You must be signed in to change notification settings - Fork 735
nginx scrap not working #68
Comments
Prometheus doesn't know how to scrape metrics directly from nginx, you'll need to use a Prometheus 'exporter' service that knows how to talk to nginx to read it's internal metrics format and present it as a scrape-able source to Prometheus. It looks like nginx provides one: https://github.com/nginxinc/nginx-prometheus-exporter And I see other community Prometheus exporters for nginx stats such as https://github.com/hnlq715/nginx-vts-exporter |
https://www.martin-helmich.de/de/blog/monitoring-nginx.html Try ths one! If you need a separate logfile: nginx allows you to add multiple access_log entries on the same level! |
Hello!
and as next step - rebuild docker stack (docker stack deploy -c docker-compose.yml mon) but when i try to get data for this job in prometheus, nothing is showen, and in web (Prometheus -> Status -> Configuration). |
If your prom is running in a container, localhost:9187 will resolve to that prom container's 127.0.0.1 address. If you are running prom and postgres as Docker compose services inside the same Docker swarm overlay network - you'll likely want to enable encryption for the overlay network, see swarmstack's compose for examples if needed. You should be able to have prom scrape the service name as listed in your swarm compose file, .e.g. postgres:9187. Otherwise, you may need to expose the postgres container's port 9187 to the Docker host network, and address prom towards either a Docker node IP or DNS record, or a round-robin DNS record for some or all of your swarm hosts. |
Thank you for your answer!
and did docker stack deploy -c docker-compose.yml mon |
Ok, i did it!
where is cranky-keldysh is a name of container with postgres_exporter |
i added
to prometheus/conf/prometheus.yml
but when i open 51.158.67.59:9090 and query to get data for this job, nothing is showen,
i already tested the same config on docker-compose locally using prometheus and everything worked properly,
just to now the address is hosted on the internet and everything work properly
The text was updated successfully, but these errors were encountered: