Prometheus 监控整合 Nginx Metrics

简介: Prometheus 监控整合 Nginx Metrics

查看nginx编译安装时安装了哪些模块


[root@nginx1 sbin]# ./nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module


加入需要安装的模块,重新编译,如这里添加–add-module=/root/mapr/nginx-module-vts


[root@nginx1 nginx]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module  --add-module=/root/mapr/nginx-module-vts

make编译 不要make install, 不然会覆盖


替换nginx二进制文件


[root@nginx1 nginx]# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak20180330
[root@nginx1 nginx]# cp ./objs/nginx /usr/local/nginx/sbin/

修改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;
        }
}

验证nginx-module-vts模块

访问http://IP/status,出现数据页面



安装nginx-vts-exporter

下载解压 exporter


chmod +x /usr/local/prometheus/nginx-vts-exporter/bin/nginx-vts-exporter 

启动exporter


./nginx-vts-exporter -nginx.scrape_uri=http://localhost/status/format/json 

修改prometheus.yml,加入下面的监控目标:

nginx-vts-exporter默认的抓取地址为http://IP:9913/metrics

相关文章
|
4月前
|
编解码 Prometheus 运维
Prometheus 的监控方法论
【1月更文挑战第24天】
|
4月前
|
存储 Prometheus 监控
Prometheus vs. ELK Stack:容器监控与日志管理工具的较量
随着容器化技术的广泛应用,容器监控与日志管理成为了关键任务。本文将对两种常用工具进行比较与选择,分别是Prometheus和ELK Stack。Prometheus是一款开源的监控系统,专注于时序数据的收集和告警。而ELK Stack则是一套完整的日志管理解决方案,由Elasticsearch、Logstash和Kibana三个组件组成。通过比较它们的特点、优势和适用场景,读者可以更好地了解如何选择适合自己需求的工具。
|
3月前
|
Prometheus 监控 Kubernetes
如何用 Prometheus Operator 监控 K8s 集群外服务?
如何用 Prometheus Operator 监控 K8s 集群外服务?
|
7月前
|
Prometheus 监控 Cloud Native
【云原生】Docker容器命令监控+Prometheus监控平台
【云原生】Docker容器命令监控+Prometheus监控平台
215 0
【云原生】Docker容器命令监控+Prometheus监控平台
|
3月前
|
Prometheus 监控 Kubernetes
Prometheus Operator 与 kube-prometheus 之二 - 如何监控 1.23+ kubeadm 集群
Prometheus Operator 与 kube-prometheus 之二 - 如何监控 1.23+ kubeadm 集群
|
6月前
|
数据采集 Prometheus 监控
监控利器之Prometheus基于Blackbox_exporter监控服务的端口
监控利器之Prometheus基于Blackbox_exporter监控服务的端口
288 0
|
3月前
|
Prometheus 监控 Cloud Native
使用 Prometheus 配置 SLO 监控和告警
使用 Prometheus 配置 SLO 监控和告警
|
4月前
|
Prometheus 监控 Java
微服务框架(二十四)Prometheus 监控埋点
此系列文章将会描述Java框架Spring Boot、服务治理框架Dubbo、应用容器引擎Docker,及使用Spring Boot集成Dubbo、Mybatis等开源框架,其中穿插着Spring Boot中日志切面等技术的实现,然后通过gitlab-CI以持续集成为Docker镜像。 本文为Prometheus 监控埋点 本系列文章中所使用的框架版本为Spring Boot 2.0.3-REL...
|
4月前
|
Prometheus 监控 Cloud Native
微服务框架(二十二)Prometheus + Grafana 可视化监控
此系列文章将会描述Java框架Spring Boot、服务治理框架Dubbo、应用容器引擎Docker,及使用Spring Boot集成Dubbo、Mybatis等开源框架,其中穿插着Spring Boot中日志切面等技术的实现,然后通过gitlab-CI以持续集成为Docker镜像。 本文为Prometheus + Grafana 可视化监控的介绍,下篇为Prometheus + Grafana...
|
4月前
|
Prometheus 监控 Cloud Native
微服务框架(十九)Spring Boot 可视化监控 Prometheus + Grafana
  此系列文章将会描述Java框架Spring Boot、服务治理框架Dubbo、应用容器引擎Docker,及使用Spring Boot集成Dubbo、Mybatis等开源框架,其中穿插着Spring Boot中日志切面等技术的实现,然后通过gitlab-CI以持续集成为Docker镜像。   本文为Spring Boot 通过 micrometer 的监控门面,实现Prometheus + G...