

























1wget https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v0.10.0/nginx-prometheus-exporter_0.10.0_linux_amd64.tar.gz
2tar -zxvf nginx-prometheus-exporter_0.10.0_linux_amd64.tar.gz -C ./nginx-exporter
1./configure \
2… \
3--with-http_stub_status_module
4make
5sudo make install
在 nginx.config 上配置
server {
# 新增
location /nginx_status {
stub_status on;
access_log off;
}
}
重启 nginx 服务
1nginx -t
2nginx -s reload
1nginx-prometheus-exporter -nginx.scrape-uri http://<nginx>:8080/nginx_status
1- job_name: "nginx-exporter"
2 file_sd_configs:
3 - files:
4 - "./file_sd/nginx-exporter.yaml"
在 ./file_sd/新建 nginx-exporter.yaml
1- targets: ["<IP>:9113"]
2 labels:
3 instance: <nginx名称>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。