📦 nginx-prometheus-exporter/ nginx
NGINX Prometheus Exporter for NGINX and NGINX Plus
Установка и запуск
Running the Exporter in a Docker Container
To start the exporter we use the docker run command.
-
To export NGINX metrics, run:
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.5.1 --nginx.scrape-uri=http://<nginx>:8080/stub_statuswhere
<nginx>is the IP address/DNS name, through which NGINX is available. -
To export NGINX Plus metrics, run:
docker run -p 9113:9113 nginx/nginx-prometheus-exporter:1.5.1 --nginx.plus --nginx.scrape-uri=http://<nginx-plus>:8080/apiwhere
<nginx-plus>is the IP address/DNS name, through which NGINX Plus is available.
Running the Exporter Binary
-
To export NGINX metrics, run:
nginx-prometheus-exporter --nginx.scrape-uri=http://<nginx>:8080/stub_statuswhere
<nginx>is the IP address/DNS name, through which NGINX is available. -
To export NGINX Plus metrics:
nginx-prometheus-exporter --nginx.plus --nginx.scrape-uri=http://<nginx-plus>:8080/apiwhere
<nginx-plus>is the IP address/DNS name, through which NGINX Plus is available. -
To scrape NGINX metrics with unix domain sockets, run:
nginx-prometheus-exporter --nginx.scrape-uri=unix:<nginx>:/stub_statuswhere
<nginx>is the path to unix domain socket, through which NGINX stub status is available.
Note. The nginx-prometheus-exporter is not a daemon. To run the exporter as a system service (daemon), you can
follow the example in examples/systemd. Alternatively, you can run the exporter
in a Docker container.
Из README репозитория · полный README на GitHub