к каталогу

📦 nginx-prometheus-exporter/ nginx

NGINX Prometheus Exporter for NGINX and NGINX Plus

Открыть на GitHubобновлён 12ч назад
Звёзды
2.0k
Форки
369
За неделю
За месяц
Рост %
Язык
Go

Установка и запуск

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_status
    

    where <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/api
    

    where <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_status
    

    where <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/api
    

    where <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_status
    

    where <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

Теги

nginxprometheusprometheus-exporter