nginx-vts-exporter:https://github.com/hnlq715/nginx-vts-exporter

nginx-module-vts模块

地址:https://github.com/vozlt/nginx-module-vts

nginx_vts_exporter依赖nginx-module-vts模块。

安装过程:略

下载

下载地址:https://github.com/hnlq715/nginx-vts-exporter/releases

1
2
3
4
mkdir -p /monitor/exporter
cd /monitor/exporter
VER=0.XX.X # 选择需要安装的版本号
wget "https://github.com/hnlq715/nginx-vts-exporter/archive/v${VER}.tar.gz" -C nginx-vts-exporter

环境变量–env参数

Variable name Default Description
NGINX_STATUS http://localhost/status/format/json Nginx JSON format status page
METRICS_ENDPOINT /metrics Metrics endpoint exportation URI
METRICS_ADDR :9913 Metrics exportation address:port
METRICS_NS nginx Prometheus metrics Namespaces

启动

1
2
3
cd nginx-vts-exporter
# 默认端口为9913
./nginx-vts-exporter -nginx.scrape_timeout 10 -nginx.scrape_uri http://127.0.0.1/status/format/json

promethues配置

1
2
3
4
5
6
7
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'nginx'
static_configs:
- targets: ['ip:9913']