nginx-vts-exporter
前题是nginx安装了vts模块
1,nginx配置文件中添加如下配置
http {
vhost_traffic_status_zone;
vhost_traffic_status_filter_by_host on;
server {
location /status {
vhost_traffic_status_display;
vhost_traffic_status_display_format html;
}
}
}
验证:
curl http://127.0.0.1/status
curl http://127.0.0.1/status/format/prometheus
2,prometheus.yml中增加配置
- job_name: ‘nginx’
metrics_path: /status/format/prometheus
static_configs:- targets: [‘10.180.136.27:80’]