Nginx 监控指标采集
简介
本文包含多个 nginx 不同类型的指标集采集,各个指标集列表如下:
nginx
nginx_upstream_check
nginx_vts_*
: 这里有一组nginx_vts_
为前缀的指标集nginx_plus_*
: 这里有一组nginx_plus_
为前缀的指标集nginx_plus_api_*
: 这里有一组nginx_plus_api_
为前缀的指标集
指标集 nginx
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 开启 nginx 的
ngx_http_stub_status_module
模块
配置
Nginx ngx_http_stub_status_module
模块配置,参见这里
进入 DataKit 安装目录下的 conf.d/nginx
目录,复制 nginx.conf.sample
并命名为 nginx.conf
。示例如下:
[[inputs.nginx]]
# An array of Nginx stub_status URI to gather stats.
urls = ["http://localhost/server_status"]
## Optional TLS Config
#tls_ca = "/etc/telegraf/ca.pem"
#tls_cert = "/etc/telegraf/cert.cer"
#tls_key = "/etc/telegraf/key.key"
## Use TLS but skip chain & host verification
#insecure_skip_verify = false
# HTTP response timeout (default: 5s)
response_timeout = "5s"
配置好后,重启 DataKit 即可生效。
标签
标签名 | 描述 |
---|---|
port |
nginx HTTP 端口 |
server |
nginx 连接地址 |
指标
指标 | 描述 | 类型 | 单位 |
---|---|---|---|
accepts |
连接总数 | int | - |
active |
当前活跃连接数 | int | - |
handled |
处理连接的总数 | int | - |
reading |
正在读取请求的连接数 | int | - |
requests |
请求总数 | int | - |
waiting |
等待请求的空闲连接数 | int | - |
writing |
正在写入响应的连接数 | int | - |
示例数据
nginx,port=80,server=localhost accepts=605i,active=2i,handled=605i,reading=0i,requests=12132i,waiting=1i,writing=1i 1456690994701784331
指标集 nginx_plus
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 开启 nginx 的
ngx_http_status_module
模块
配置
Nginx ngx_http_status_module
模块配置,参见这里
进入 DataKit 安装目录下的 conf.d/nginx
目录,复制 nginx_plus.conf.sample
并命名为 nginx_plus.conf
。示例如下:
[[inputs.nginx_plus]]
## An array of ngx_http_status_module or status URI to gather stats.
urls = ["http://localhost/status"]
# HTTP response timeout (default: 5s)
response_timeout = "5s"
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
配置好后,重启 DataKit 即可生效。
标签
指标集:
nginx_plus_processes
,nginx_plus_connections
,nginx_plus_ssl
,nginx_plus_requests
server
port
指标集:
nginx_plus_upstream
,nginx_plus_stream_upstream
upstream
server
port
指标集:
nginx_plus_upstream_peer
,nginx_plus_stream_upstream_peer
id
upstream
server
port
upstream_address
指标
- 指标集:
nginx_plus_processes
respawned
- 指标集:
nginx_plus_connections
accepted
dropped
active
idle
- 指标集:
nginx_plus_ssl
handshakes
handshakes_failed
session_reuses
- 指标集:
nginx_plus_requests
total
current
- 指标集:
nginx_plus_upstream
,nginx_plus_stream_upstream
keepalive
zombies
- 指标集:
nginx_plus_upstream_peer
,nginx_plus_stream_upstream_peer
requests
unavail
healthchecks_checks
header_time
response_time
state
active
downstart
healthchecks_last_passed
weight
responses_1xx
responses_2xx
responses_3xx
responses_4xx
responses_5xx
received
selected
healthchecks_fails
healthchecks_unhealthy
backup
responses_total
sent
fails
downtime
示例数据
nginx_plus_processes,server=localhost,port=12021,host=word.local respawned=0i 1505782513000000000
nginx_plus_connections,server=localhost,port=12021,host=word.local accepted=5535735212i,dropped=10140186i,active=9541i,idle=67540i 1505782513000000000
nginx_plus_ssl,server=localhost,port=12021,host=word.local handshakes=0i,handshakes_failed=0i,session_reuses=0i 1505782513000000000
nginx_plus_requests,server=localhost,port=12021,host=word.local total=186780541173i,current=9037i 1505782513000000000
nginx_plus_upstream,port=12021,host=word.local,upstream=dataserver80,server=localhost keepalive=0i,zombies=0i 1505782513000000000
nginx_plus_upstream_peer,upstream=dataserver80,upstream_address=10.10.102.181:80,id=0,server=localhost,port=12021,host=word.local sent=53806910399i,received=7516943964i,fails=207i,downtime=2325979i,selected=1505782512000i,backup=false,active=6i,responses_4xx=6935i,header_time=80i,response_time=80i,healthchecks_last_passed=true,responses_1xx=0i,responses_2xx=36299890i,responses_5xx=360450i,responses_total=36667275i,unavail=154i,downstart=0i,state="up",requests=36673741i,responses_3xx=0i,healthchecks_unhealthy=5i,weight=1i,healthchecks_checks=177209i,healthchecks_fails=29i 1505782513000000000
nginx_plus_stream_upstream,server=localhost,port=12021,host=word.local,upstream=dataserver443 zombies=0i 1505782513000000000
nginx_plus_stream_upstream_peer,server=localhost,upstream_address=10.10.102.181:443,id=0,port=12021,host=word.local,upstream=dataserver443 active=1i,healthchecks_unhealthy=1i,weight=1i,unavail=0i,connect_time=24i,first_byte_time=78i,healthchecks_last_passed=true,state="up",sent=4457713140i,received=698065272i,fails=0i,healthchecks_checks=178421i,downstart=0i,selected=1505782512000i,response_time=5156i,backup=false,connections=56251i,healthchecks_fails=20i,downtime=391017i 1505782513000000000
指标集 nginx_plus_api_*
这里会有多个指标集,指标集名称都以 nginx_plus_api_
为前缀。
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 开启 nginx 的
ngx_http_api_module
模块
配置
Nginx ngx_http_api_module
模块配置,参见这里
进入 DataKit 安装目录下的 conf.d/nginx
目录,复制 nginx_plus_api.conf.sample
并命名为 nginx_plus_api.conf
。示例如下:
[[inputs.nginx_plus_api]]
## An array of API URI to gather stats.
urls = ["http://localhost/api"]
# Nginx API version, default: 3
# api_version = 3
# HTTP response timeout (default: 5s)
response_timeout = "5s"
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
配置好后,重启 DataKit 即可生效。
标签
指标集:
nginx_plus_api_processes, nginx_plus_api_connections, nginx_plus_api_ssl, nginx_plus_api_http_requests
source
port
指标集:
nginx_plus_api_http_upstreams, nginx_plus_api_stream_upstreams
upstream
source
port
指标集:
nginx_plus_api_http_server_zones, nginx_plus_api_upstream_server_zones, nginx_plus_api_http_location_zones, nginx_plus_api_resolver_zones
source
port
zone
指标集:
nginx_plus_api_upstream_peers, nginx_plus_api_stream_upstream_peers
id
upstream
source
port
upstream_address
指标集:
nginx_plus_api_http_caches
source
port
指标
- 指标集:
nginx_plus_api_processes
respawned
- 指标集:
nginx_plus_api_connections
accepted
dropped
active
idle
- 指标集:
nginx_plus_api_ssl
handshakes
handshakes_failed
session_reuses
- 指标集:
nginx_plus_api_http_requests
total
current
- 指标集:
nginx_plus_api_http_server_zones
processing
requests
responses_1xx
responses_2xx
responses_3xx
responses_4xx
responses_5xx
responses_total
received
sent
discarded
- 指标集:
nginx_plus_api_http_upstreams
keepalive
zombies
- 指标集:
nginx_plus_api_http_upstream_peers
requests
unavail
healthchecks_checks
header_time
state
response_time
active
healthchecks_last_passed
weight
responses_1xx
responses_2xx
responses_3xx
responses_4xx
responses_5xx
received
healthchecks_fails
healthchecks_unhealthy
backup
responses_total
sent
fails
downtime
- 指标集:
nginx_plus_api_http_caches
size
max_size
cold
hit_responses
hit_bytes
stale_responses
stale_bytes
updating_responses
updating_bytes
revalidated_responses
revalidated_bytes
miss_responses
miss_bytes
miss_responses_written
miss_bytes_written
expired_responses
expired_bytes
expired_responses_written
expired_bytes_written
bypass_responses
bypass_bytes
bypass_responses_written
bypass_bytes_written
- 指标集:
nginx_plus_api_stream_upstreams
zombies
- 指标集:
nginx_plus_api_stream_upstream_peers
unavail
healthchecks_checks
healthchecks_fails
healthchecks_unhealthy
healthchecks_last_passed
response_time
state
active
weight
received
backup
sent
fails
downtime
- 指标集:
nginx_plus_api_stream_server_zones
processing
connections
received
sent
- 指标集:
nginx_plus_api_location_zones
requests
responses_1xx
responses_2xx
responses_3xx
responses_4xx
responses_5xx
responses_total
received
sent
discarded
- 指标集:
nginx_plus_api_resolver_zones
name
srv
addr
noerror
formerr
servfail
nxdomain
notimp
refused
timedout
unknown
示例数据
nginx_plus_api_processes,port=80,source=demo.nginx.com respawned=0i 1570696321000000000
nginx_plus_api_connections,port=80,source=demo.nginx.com accepted=68998606i,active=7i,dropped=0i,idle=57i 1570696322000000000
nginx_plus_api_ssl,port=80,source=demo.nginx.com handshakes=9398978i,handshakes_failed=289353i,session_reuses=1004389i 1570696322000000000
nginx_plus_api_http_requests,port=80,source=demo.nginx.com current=51i,total=264649353i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=hg.nginx.org discarded=5i,processing=0i,received=24123604i,requests=60138i,responses_1xx=0i,responses_2xx=59353i,responses_3xx=531i,responses_4xx=249i,responses_5xx=0i,responses_total=60133i,sent=830165221i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=trac.nginx.org discarded=250i,processing=0i,received=2184618i,requests=12404i,responses_1xx=0i,responses_2xx=8579i,responses_3xx=2513i,responses_4xx=583i,responses_5xx=479i,responses_total=12154i,sent=139384159i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=lxr.nginx.org discarded=1i,processing=0i,received=1011701i,requests=4523i,responses_1xx=0i,responses_2xx=4332i,responses_3xx=28i,responses_4xx=39i,responses_5xx=123i,responses_total=4522i,sent=72631354i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=trac-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=trac-backend,upstream_address=10.0.0.1:8080 active=0i,backup=false,downtime=0i,fails=0i,header_time=235i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=88581178i,requests=3180i,response_time=235i,responses_1xx=0i,responses_2xx=3168i,responses_3xx=5i,responses_4xx=6i,responses_5xx=0i,responses_total=3179i,sent=1321720i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=trac-backend,upstream_address=10.0.0.1:8081 active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=hg-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=hg-backend,upstream_address=10.0.0.1:8088 active=0i,backup=false,downtime=0i,fails=0i,header_time=22i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=909402572i,requests=18514i,response_time=88i,responses_1xx=0i,responses_2xx=17799i,responses_3xx=531i,responses_4xx=179i,responses_5xx=0i,responses_total=18509i,sent=10608107i,state="up",unavail=0i,weight=5i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=hg-backend,upstream_address=10.0.0.1:8089 active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=lxr-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=lxr-backend,upstream_address=unix:/tmp/cgi.sock active=0i,backup=false,downtime=0i,fails=123i,header_time=91i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=71782888i,requests=4354i,response_time=91i,responses_1xx=0i,responses_2xx=4230i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=4230i,sent=3088656i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=lxr-backend,upstream_address=unix:/tmp/cgib.sock active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,max_conns=42i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=demo-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=demo-backend,upstream_address=10.0.0.2:15431 active=0i,backup=false,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_caches,cache=http_cache,port=80,source=demo.nginx.com bypass_bytes=0i,bypass_bytes_written=0i,bypass_responses=0i,bypass_responses_written=0i,cold=false,expired_bytes=381518640i,expired_bytes_written=363449785i,expired_responses=42114i,expired_responses_written=39954i,hit_bytes=6321885979i,hit_responses=596730i,max_size=536870912i,miss_bytes=48512185i,miss_bytes_written=155600i,miss_responses=6052i,miss_responses_written=136i,revalidated_bytes=0i,revalidated_responses=0i,size=765952i,stale_bytes=0i,stale_responses=0i,updating_bytes=0i,updating_responses=0i 1570696323000000000
nginx_plus_api_stream_server_zones,port=80,source=demo.nginx.com,zone=postgresql_loadbalancer connections=0i,processing=0i,received=0i,sent=0i 1570696323000000000
nginx_plus_api_stream_server_zones,port=80,source=demo.nginx.com,zone=dns_loadbalancer connections=0i,processing=0i,received=0i,sent=0i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=postgresql_backends zombies=0i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15432 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15433 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=2,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15434 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=3,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15435 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="down",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=dns_udp_backends zombies=0i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.5:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=2i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.2:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=2,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.7:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="down",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=unused_tcp_backends zombies=0i 1570696323000000000
nginx_plus_api_http_location_zones,port=80,source=demo.nginx.com,zone=swagger discarded=0i,received=1622i,requests=8i,responses_1xx=0i,responses_2xx=7i,responses_3xx=0i,responses_4xx=1i,responses_5xx=0i,responses_total=8i,sent=638333i 1570696323000000000
nginx_plus_api_http_location_zones,port=80,source=demo.nginx.com,zone=api-calls discarded=64i,received=337530181i,requests=1726513i,responses_1xx=0i,responses_2xx=1726428i,responses_3xx=0i,responses_4xx=21i,responses_5xx=0i,responses_total=1726449i,sent=1902577668i 1570696323000000000
nginx_plus_api_resolver_zones,port=80,source=demo.nginx.com,zone=resolver1 addr=0i,formerr=0i,name=0i,noerror=0i,notimp=0i,nxdomain=0i,refused=0i,servfail=0i,srv=0i,timedout=0i,unknown=0i 1570696324000000000
参考
参见 nginx API 文档
指标集 nginx_upstream_check
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 添加 nginx 的
nginx_upstream_check
模块
配置
Nginx nginx_upstream_check
模块配置,参见这里
进入 DataKit 安装目录下的 conf.d/nginx
目录,复制 nginx_upstream_check.conf.sample
并命名为 nginx_upstream_check.conf
。示例如下:
[[inputs.nginx_upstream_check]]
## An URL where Nginx Upstream check module is enabled
## It should be set to return a JSON formatted response
url = "http://127.0.0.1/status?format=json"
## HTTP method
# method = "GET"
## Optional HTTP headers
# headers = {"X-Special-Header" = "Special-Value"}
## Override HTTP "Host" header
# host_header = "check.example.com"
## Timeout for HTTP requests
timeout = "5s"
## Optional HTTP Basic Auth credentials
# username = "username"
# password = "pa$$word"
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
配置好后,重启 DataKit 即可生效。
标签
标签名 | 描述 |
---|---|
name |
upstream 服务的 hostname 或 IP |
port |
upstream 服务可选的检测端口,如果用默认端口,则为 0 |
type |
upstream 服务的检测类型(http/tcp) |
upstream |
Nginx 配置文件中,upstream 服务的配置块名称 |
url |
Nginx 的 status URL |
指标
指标 | 描述 | 类型 | 单位 |
---|---|---|---|
fall |
upstream 服务检查失败次数 | int | |
rise |
upstream 服务检查成功次数 | int | |
status |
upstream 服务状态码 | string | |
status_code |
服务状态码(1: up, 2: down, 0: other) | int |
示例数据
nginx_upstream_check,host=node1,name=192.168.0.1:8080,port=0,type=http,upstream=my_backends,url=http://127.0.0.1:80/status?format\=json fall=0i,rise=100i,status="up",status_code=1i 1529088524000000000
nginx_upstream_check,host=node2,name=192.168.0.2:8080,port=0,type=http,upstream=my_backends,url=http://127.0.0.1:80/status?format\=json fall=100i,rise=0i,status="down",status_code=2i 1529088524000000000
指标集 nginx_vts_*
前置条件
- 已安装 DataKit(DataKit 安装文档)
- 添加 nginx 的
nginx-module-vts
模块
配置
进入 DataKit 安装目录下的 conf.d/nginx
目录,复制 nginx_vts.conf.sample
并命名为 nginx_vts.conf
。示例如下:
[[inputs.nginx_vts]]
## An array of ngx_http_status_module or status URI to gather stats.
urls = ["http://localhost/status"]
## HTTP response timeout (default: 5s)
response_timeout = "5s"
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
配置好后,重启 DataKit 即可生效。
标签
- 指标集:
nginx_vts_connections
source
port
- 指标集:
nginx_vts_server
source
port
zone
- 指标集:
nginx_vts_filter
source
port
filter_name
filter_key
- 指标集:
nginx_vts_upstream
source
port
upstream
upstream_address
- 指标集:
nginx_vts_cache
source
port
zone
指标
指标集:
nginx_vts_connections
active
reading
writing
waiting
accepted
handled
requests
指标集:
nginx_vts_server, nginx_vts_filter
requests
request_time
in_bytes
out_bytes
response_1xx_count
response_2xx_count
response_3xx_count
response_4xx_count
response_5xx_count
cache_miss
cache_bypass
cache_expired
cache_stale
cache_updating
cache_revalidated
cache_hit
cache_scarce
指标集:
nginx_vts_upstream
requests
request_time
response_time
in_bytes
out_bytes
response_1xx_count
response_2xx_count
response_3xx_count
response_4xx_count
response_5xx_count
weight
max_fails
fail_timeout
backup
down
指标集:
nginx_vts_cache
max_bytes
used_bytes
in_bytes
out_bytes
miss
bypass
expired
stale
updating
revalidated
hit
scarce
示例数据
nginx_vts_connections,source=localhost,port=80,host=localhost waiting=30i,accepted=295333i,handled=295333i,requests=6833487i,active=33i,reading=0i,writing=3i 1518341521000000000
nginx_vts_server,zone=example.com,port=80,host=localhost,source=localhost cache_hit=158915i,in_bytes=1935528964i,out_bytes=6531366419i,response_2xx_count=809994i,response_4xx_count=16664i,cache_bypass=0i,cache_stale=0i,cache_revalidated=0i,requests=2187977i,response_1xx_count=0i,response_3xx_count=1360390i,cache_miss=2249i,cache_updating=0i,cache_scarce=0i,request_time=13i,response_5xx_count=929i,cache_expired=0i 1518341521000000000
nginx_vts_server,host=localhost,source=localhost,port=80,zone=* requests=6775284i,in_bytes=5003242389i,out_bytes=36858233827i,cache_expired=318881i,cache_updating=0i,request_time=51i,response_1xx_count=0i,response_2xx_count=4385916i,response_4xx_count=83680i,response_5xx_count=1186i,cache_bypass=0i,cache_revalidated=0i,cache_hit=1972222i,cache_scarce=0i,response_3xx_count=2304502i,cache_miss=408251i,cache_stale=0i 1518341521000000000
nginx_vts_filter,filter_key=FI,filter_name=country,port=80,host=localhost,source=localhost request_time=0i,in_bytes=139701i,response_3xx_count=0i,out_bytes=2644495i,response_1xx_count=0i,cache_expired=0i,cache_scarce=0i,requests=179i,cache_miss=0i,cache_bypass=0i,cache_stale=0i,cache_updating=0i,cache_revalidated=0i,cache_hit=0i,response_2xx_count=177i,response_4xx_count=2i,response_5xx_count=0i 1518341521000000000
nginx_vts_upstream,port=80,host=localhost,upstream=backend_cluster,upstream_address=127.0.0.1:6000,source=localhost fail_timeout=10i,backup=false,request_time=31i,response_5xx_count=1081i,response_2xx_count=1877498i,max_fails=1i,in_bytes=2763336289i,out_bytes=19470265071i,weight=1i,down=false,response_time=31i,response_1xx_count=0i,response_4xx_count=76125i,requests=3379232i,response_3xx_count=1424528i 1518341521000000000
nginx_vts_cache,source=localhost,port=80,host=localhost,zone=example stale=0i,used_bytes=64334336i,miss=394573i,bypass=0i,expired=318788i,updating=0i,revalidated=0i,hit=689883i,scarce=0i,max_bytes=9223372036854775296i,in_bytes=1111161581i,out_bytes=19175548290i 1518341521000000000