Nginx VTS/STS Performance Metrics

Dashboard

Performance metrics for Nginx by Very Good Security
Last updated: 7 months ago

Downloads: 115

Reviews: 0

  • Screenshot 2020-03-22 at 15.49.21.png
    Screenshot 2020-03-22 at 15.49.21.png
  • Screenshot 2020-03-22 at 15.49.34.png
    Screenshot 2020-03-22 at 15.49.34.png
  • Screenshot 2020-03-22 at 15.49.43.png
    Screenshot 2020-03-22 at 15.49.43.png
  • Screenshot 2020-03-22 at 15.50.04.png
    Screenshot 2020-03-22 at 15.50.04.png
  • Screenshot 2020-03-22 at 15.50.15.png
    Screenshot 2020-03-22 at 15.50.15.png
  • Screenshot 2020-03-22 at 15.50.24.png
    Screenshot 2020-03-22 at 15.50.24.png
  • Screenshot 2020-03-22 at 15.50.33.png
    Screenshot 2020-03-22 at 15.50.33.png
  • Screenshot 2020-03-22 at 15.50.41.png
    Screenshot 2020-03-22 at 15.50.41.png

1. Nginx has to be compiled with these 4 plugins

nginx -V
# other stuff
--with-http_stub_status_module
--add-module=/usr/src/nginx-module-vts
--add-module=/usr/src/nginx-module-sts
--add-module=/usr/src/nginx-module-stream-sts

these modules can be found here:

  • https://github.com/vozlt/nginx-module-vts
  • https://github.com/vozlt/nginx-module-sts
  • https://github.com/vozlt/nginx-module-stream-sts

2. Nginx config should looks similar to this:

server {
    listen 127.0.0.1:80;
    server_name 127.0.0.1;
    allow 127.0.0.1;
    deny all;

    # default nginx's metrics
    location /nginx_status {
        stub_status;
    }

    location /http_traffic_status {
        vhost_traffic_status_bypass_limit on;
        vhost_traffic_status_bypass_stats on;
        vhost_traffic_status_display;
        vhost_traffic_status_display_format html;
    }

    location /stream_traffic_status {
        stream_server_traffic_status_display;
        stream_server_traffic_status_display_format html;
    }
}

Collector Configuration Details

Telegraf config

Outputs

[outputs]

# Configuration for influxdb server to send metrics to

[[outputs.socket_writer]]
  address = "tcp://your-influx:8094"
  data_format = "influx"

Inputs

[[inputs.mem]]
[[inputs.system]]
[[inputs.cpu]]
    fielddrop = [ "time_*" ]
    totalcpu = true
    percpu = true
[[inputs.disk]]
[[inputs.diskio]]
    skip_serial_number = true
[[inputs.net]]
    interfaces = [ "eth0" ]
[[inputs.nginx]]
    response_timeout = "5s"
    urls = [ "http://127.0.0.1/nginx_status" ]
[[inputs.nginx_vts]]
    urls = [ "http://127.0.0.1/http_traffic_status/status/format/json" ]
[[inputs.nginx_sts]]
    urls = [ "http://127.0.0.1/stream_traffic_status/status/format/json" ]

nginx_sts plugin

At the moment of publishing of this board telegraf didn't have "nginx_sts" support. So it can be found at Very Good Security fork: https://github.com/verygoodsecurity/telegraf/tree/master/plugins/inputs/nginx_sts.