Skip to content

Instantly share code, notes, and snippets.

@freeseacher
Created November 19, 2018 09:18
Show Gist options
  • Save freeseacher/5cfacba691e786d7837dc9d97702b465 to your computer and use it in GitHub Desktop.
Save freeseacher/5cfacba691e786d7837dc9d97702b465 to your computer and use it in GitHub Desktop.
nginx vts and
% curl http://0.0.0.0:9099/metrics
# HELP nginx_vts_info Nginx info
# TYPE nginx_vts_info gauge
nginx_vts_info{hostname="bca8ca4d104a",version="1.13.1"} 1
# HELP nginx_vts_start_time_seconds Nginx start time
# TYPE nginx_vts_start_time_seconds gauge
nginx_vts_start_time_seconds 1542618835.871
# HELP nginx_vts_main_connections Nginx connections
# TYPE nginx_vts_main_connections gauge
nginx_vts_main_connections{status="accepted"} 2
nginx_vts_main_connections{status="active"} 1
nginx_vts_main_connections{status="handled"} 2
nginx_vts_main_connections{status="reading"} 0
nginx_vts_main_connections{status="requests"} 2
nginx_vts_main_connections{status="waiting"} 0
nginx_vts_main_connections{status="writing"} 1
# HELP nginx_vts_main_shm_usage_bytes Shared memory [ngx_http_vhost_traffic_status] info
# TYPE nginx_vts_main_shm_usage_bytes gauge
nginx_vts_main_shm_usage_bytes{shared="max_size"} 1048575
nginx_vts_main_shm_usage_bytes{shared="used_size"} 10560
nginx_vts_main_shm_usage_bytes{shared="used_node"} 3
# HELP nginx_vts_server_bytes_total The request/response bytes
# TYPE nginx_vts_server_bytes_total counter
# HELP nginx_vts_server_requests_total The requests counter
# TYPE nginx_vts_server_requests_total counter
# HELP nginx_vts_server_request_seconds_total The request processing time in seconds
# TYPE nginx_vts_server_request_seconds_total counter
# HELP nginx_vts_server_request_seconds The average of request processing times in seconds
# TYPE nginx_vts_server_request_seconds gauge
# HELP nginx_vts_server_request_duration_seconds The histogram of request processing time
# TYPE nginx_vts_server_request_duration_seconds histogram
# HELP nginx_vts_server_cache_total The requests cache counter
# TYPE nginx_vts_server_cache_total counter
nginx_vts_server_bytes_total{host="_",direction="in"} 76
nginx_vts_server_bytes_total{host="_",direction="out"} 330
nginx_vts_server_requests_total{host="_",code="1xx"} 0
nginx_vts_server_requests_total{host="_",code="2xx"} 0
nginx_vts_server_requests_total{host="_",code="3xx"} 0
nginx_vts_server_requests_total{host="_",code="4xx"} 0
nginx_vts_server_requests_total{host="_",code="5xx"} 1
nginx_vts_server_requests_total{host="_",code="total"} 1
nginx_vts_server_request_seconds_total{host="_"} 0.000
nginx_vts_server_request_seconds{host="_"} 0.000
nginx_vts_server_cache_total{host="_",status="miss"} 0
nginx_vts_server_cache_total{host="_",status="bypass"} 0
nginx_vts_server_cache_total{host="_",status="expired"} 0
nginx_vts_server_cache_total{host="_",status="stale"} 0
nginx_vts_server_cache_total{host="_",status="updating"} 0
nginx_vts_server_cache_total{host="_",status="revalidated"} 0
nginx_vts_server_cache_total{host="_",status="hit"} 0
nginx_vts_server_cache_total{host="_",status="scarce"} 0
nginx_vts_server_bytes_total{host="*",direction="in"} 76
nginx_vts_server_bytes_total{host="*",direction="out"} 330
nginx_vts_server_requests_total{host="*",code="1xx"} 0
nginx_vts_server_requests_total{host="*",code="2xx"} 0
nginx_vts_server_requests_total{host="*",code="3xx"} 0
nginx_vts_server_requests_total{host="*",code="4xx"} 0
nginx_vts_server_requests_total{host="*",code="5xx"} 1
nginx_vts_server_requests_total{host="*",code="total"} 1
nginx_vts_server_request_seconds_total{host="*"} 0.000
nginx_vts_server_request_seconds{host="*"} 0.000
nginx_vts_server_cache_total{host="*",status="miss"} 0
nginx_vts_server_cache_total{host="*",status="bypass"} 0
nginx_vts_server_cache_total{host="*",status="expired"} 0
nginx_vts_server_cache_total{host="*",status="stale"} 0
nginx_vts_server_cache_total{host="*",status="updating"} 0
nginx_vts_server_cache_total{host="*",status="revalidated"} 0
nginx_vts_server_cache_total{host="*",status="hit"} 0
nginx_vts_server_cache_total{host="*",status="scarce"} 0
# HELP nginx_vts_filter_bytes_total The request/response bytes
# TYPE nginx_vts_filter_bytes_total counter
# HELP nginx_vts_filter_requests_total The requests counter
# TYPE nginx_vts_filter_requests_total counter
# HELP nginx_vts_filter_request_seconds_total The request processing time in seconds counter
# TYPE nginx_vts_filter_request_seconds_total counter
# HELP nginx_vts_filter_request_seconds The average of request processing times in seconds
# TYPE nginx_vts_filter_request_seconds gauge
# HELP nginx_vts_filter_request_duration_seconds The histogram of request processing time
# TYPE nginx_vts_filter_request_duration_seconds histogram
# HELP nginx_vts_filter_cache_total The requests cache counter
# TYPE nginx_vts_filter_cache_total counter
nginx_vts_filter_bytes_total{filter="checkup::my",filter_name="502",direction="in"} 76
nginx_vts_filter_bytes_total{filter="checkup::my",filter_name="502",direction="out"} 330
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="1xx"} 0
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="2xx"} 0
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="3xx"} 0
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="4xx"} 0
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="5xx"} 1
nginx_vts_filter_requests_total{filter="checkup::my",filter_name="502",direction="total"} 1
nginx_vts_filter_request_seconds_total{filter="checkup::my",filter_name="502"} 0.000
nginx_vts_filter_request_seconds{filter="checkup::my",filter_name="502"} 0.000
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="miss"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="bypass"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="expired"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="stale"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="updating"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="revalidated"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="hit"} 0
nginx_vts_filter_cache_total{filter="checkup::my",filter_name="502",status="scarce"} 0
# HELP nginx_vts_upstream_bytes_total The request/response bytes
# TYPE nginx_vts_upstream_bytes_total counter
# HELP nginx_vts_upstream_requests_total The upstream requests counter
# TYPE nginx_vts_upstream_requests_total counter
# HELP nginx_vts_upstream_request_seconds_total The request Processing time including upstream in seconds
# TYPE nginx_vts_upstream_request_seconds_total counter
# HELP nginx_vts_upstream_request_seconds The average of request processing times including upstream in seconds
# TYPE nginx_vts_upstream_request_seconds gauge
# HELP nginx_vts_upstream_response_seconds_total The only upstream response processing time in seconds
# TYPE nginx_vts_upstream_response_seconds_total counter
# HELP nginx_vts_upstream_response_seconds The average of only upstream response processing times in seconds
# TYPE nginx_vts_upstream_response_seconds gauge
# HELP nginx_vts_upstream_request_duration_seconds The histogram of request processing time including upstream
# TYPE nginx_vts_upstream_request_duration_seconds histogram
# HELP nginx_vts_upstream_response_duration_seconds The histogram of only upstream response processing time
# TYPE nginx_vts_upstream_response_duration_seconds histogram
nginx_vts_upstream_bytes_total{upstream="my",backend="127.0.0.1:9007",direction="in"} 76
nginx_vts_upstream_bytes_total{upstream="my",backend="127.0.0.1:9007",direction="out"} 330
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="1xx"} 0
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="2xx"} 0
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="3xx"} 0
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="4xx"} 0
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="5xx"} 1
nginx_vts_upstream_requests_total{upstream="my",backend="127.0.0.1:9007",code="total"} 1
nginx_vts_upstream_request_seconds_total{upstream="my",backend="127.0.0.1:9007"} 0.000
nginx_vts_upstream_request_seconds{upstream="my",backend="127.0.0.1:9007"} 0.000
nginx_vts_upstream_response_seconds_total{upstream="my",backend="127.0.0.1:9007"} 0.000
nginx_vts_upstream_response_seconds{upstream="my",backend="127.0.0.1:9007"} 0.000
user www-data;
load_module modules/ngx_http_vhost_traffic_status_module.so;
events {
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
vhost_traffic_status_zone;
upstream my {
server 127.0.0.1:9007 fail_timeout=10s;
}
server {
listen 0.0.0.0:8080;
error_log /dev/stdout info;
access_log /dev/stdout;
error_page 500 502 503 504 @s3_maintenance;
location /metrics {
vhost_traffic_status_display;
vhost_traffic_status_display_format prometheus;
}
location / {
proxy_pass https://my;
vhost_traffic_status_filter_by_set_key $status checkup::my;
}
location @s3_maintenance {
resolver 8.8.8.8;
set $maintpage "maintenance-page.s3-website-us-east-1.amazonaws.com/maintenance.html";
proxy_set_header Host "s3.amazonaws.com";
proxy_pass http://$maintpage;
}
}
}
% curl http://0.0.0.0:9099/metrics
# HELP nginx_vts_info Nginx info
# TYPE nginx_vts_info gauge
nginx_vts_info{hostname="bca8ca4d104a",version="1.13.1"} 1
# HELP nginx_vts_start_time_seconds Nginx start time
# TYPE nginx_vts_start_time_seconds gauge
nginx_vts_start_time_seconds 1542619083.159
# HELP nginx_vts_main_connections Nginx connections
# TYPE nginx_vts_main_connections gauge
nginx_vts_main_connections{status="accepted"} 2
nginx_vts_main_connections{status="active"} 1
nginx_vts_main_connections{status="handled"} 2
nginx_vts_main_connections{status="reading"} 0
nginx_vts_main_connections{status="requests"} 2
nginx_vts_main_connections{status="waiting"} 0
nginx_vts_main_connections{status="writing"} 1
# HELP nginx_vts_main_shm_usage_bytes Shared memory [ngx_http_vhost_traffic_status] info
# TYPE nginx_vts_main_shm_usage_bytes gauge
nginx_vts_main_shm_usage_bytes{shared="max_size"} 1048575
nginx_vts_main_shm_usage_bytes{shared="used_size"} 7033
nginx_vts_main_shm_usage_bytes{shared="used_node"} 2
# HELP nginx_vts_server_bytes_total The request/response bytes
# TYPE nginx_vts_server_bytes_total counter
# HELP nginx_vts_server_requests_total The requests counter
# TYPE nginx_vts_server_requests_total counter
# HELP nginx_vts_server_request_seconds_total The request processing time in seconds
# TYPE nginx_vts_server_request_seconds_total counter
# HELP nginx_vts_server_request_seconds The average of request processing times in seconds
# TYPE nginx_vts_server_request_seconds gauge
# HELP nginx_vts_server_request_duration_seconds The histogram of request processing time
# TYPE nginx_vts_server_request_duration_seconds histogram
# HELP nginx_vts_server_cache_total The requests cache counter
# TYPE nginx_vts_server_cache_total counter
nginx_vts_server_bytes_total{host="_",direction="in"} 76
nginx_vts_server_bytes_total{host="_",direction="out"} 698
nginx_vts_server_requests_total{host="_",code="1xx"} 0
nginx_vts_server_requests_total{host="_",code="2xx"} 0
nginx_vts_server_requests_total{host="_",code="3xx"} 0
nginx_vts_server_requests_total{host="_",code="4xx"} 0
nginx_vts_server_requests_total{host="_",code="5xx"} 1
nginx_vts_server_requests_total{host="_",code="total"} 1
nginx_vts_server_request_seconds_total{host="_"} 0.258
nginx_vts_server_request_seconds{host="_"} 0.004
nginx_vts_server_cache_total{host="_",status="miss"} 0
nginx_vts_server_cache_total{host="_",status="bypass"} 0
nginx_vts_server_cache_total{host="_",status="expired"} 0
nginx_vts_server_cache_total{host="_",status="stale"} 0
nginx_vts_server_cache_total{host="_",status="updating"} 0
nginx_vts_server_cache_total{host="_",status="revalidated"} 0
nginx_vts_server_cache_total{host="_",status="hit"} 0
nginx_vts_server_cache_total{host="_",status="scarce"} 0
nginx_vts_server_bytes_total{host="*",direction="in"} 76
nginx_vts_server_bytes_total{host="*",direction="out"} 698
nginx_vts_server_requests_total{host="*",code="1xx"} 0
nginx_vts_server_requests_total{host="*",code="2xx"} 0
nginx_vts_server_requests_total{host="*",code="3xx"} 0
nginx_vts_server_requests_total{host="*",code="4xx"} 0
nginx_vts_server_requests_total{host="*",code="5xx"} 1
nginx_vts_server_requests_total{host="*",code="total"} 1
nginx_vts_server_request_seconds_total{host="*"} 0.258
nginx_vts_server_request_seconds{host="*"} 0.000
nginx_vts_server_cache_total{host="*",status="miss"} 0
nginx_vts_server_cache_total{host="*",status="bypass"} 0
nginx_vts_server_cache_total{host="*",status="expired"} 0
nginx_vts_server_cache_total{host="*",status="stale"} 0
nginx_vts_server_cache_total{host="*",status="updating"} 0
nginx_vts_server_cache_total{host="*",status="revalidated"} 0
nginx_vts_server_cache_total{host="*",status="hit"} 0
nginx_vts_server_cache_total{host="*",status="scarce"} 0
# HELP nginx_vts_upstream_bytes_total The request/response bytes
# TYPE nginx_vts_upstream_bytes_total counter
# HELP nginx_vts_upstream_requests_total The upstream requests counter
# TYPE nginx_vts_upstream_requests_total counter
# HELP nginx_vts_upstream_request_seconds_total The request Processing time including upstream in seconds
# TYPE nginx_vts_upstream_request_seconds_total counter
# HELP nginx_vts_upstream_request_seconds The average of request processing times including upstream in seconds
# TYPE nginx_vts_upstream_request_seconds gauge
# HELP nginx_vts_upstream_response_seconds_total The only upstream response processing time in seconds
# TYPE nginx_vts_upstream_response_seconds_total counter
# HELP nginx_vts_upstream_response_seconds The average of only upstream response processing times in seconds
# TYPE nginx_vts_upstream_response_seconds gauge
# HELP nginx_vts_upstream_request_duration_seconds The histogram of request processing time including upstream
# TYPE nginx_vts_upstream_request_duration_seconds histogram
# HELP nginx_vts_upstream_response_duration_seconds The histogram of only upstream response processing time
# TYPE nginx_vts_upstream_response_duration_seconds histogram
nginx_vts_upstream_bytes_total{upstream="::nogroups",backend="127.0.0.1:9007",direction="in"} 76
nginx_vts_upstream_bytes_total{upstream="::nogroups",backend="127.0.0.1:9007",direction="out"} 698
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="1xx"} 0
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="2xx"} 0
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="3xx"} 0
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="4xx"} 0
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="5xx"} 1
nginx_vts_upstream_requests_total{upstream="::nogroups",backend="127.0.0.1:9007",code="total"} 1
nginx_vts_upstream_request_seconds_total{upstream="::nogroups",backend="127.0.0.1:9007"} 0.258
nginx_vts_upstream_request_seconds{upstream="::nogroups",backend="127.0.0.1:9007"} 0.004
nginx_vts_upstream_response_seconds_total{upstream="::nogroups",backend="127.0.0.1:9007"} 0.239
nginx_vts_upstream_response_seconds{upstream="::nogroups",backend="127.0.0.1:9007"} 0.003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment