Nginx Metrics with InstrumentalD

Nginx logo

The best way to get Nginx metrics into Instrumental is with InstrumentalD, the fast and reliable server agent created by the Instrumental team. By using InstrumentalD to collect Nginx metrics, you'll get premade Nginx graphs and unlock the full power of our Query Language.

Quick Start

Check out our Getting Started Guide for all the details. Otherwise, here's the bare minimum to get up and running. (You'll need a project token.)

brew install instrumental/instrumentald/instrumentald
echo 'nginx = ["http://localhost:80/status"]' > instrumentald.toml
instrumentald -c instrumentald.toml -k PROJECT_TOKEN
curl | sudo bash
sudo apt-get install instrumentald
echo 'nginx = ["http://localhost:80/status"]' > instrumentald.toml
sudo /opt/instrumentald/instrumentald -c instrumentald.toml -k PROJECT_TOKEN
curl | sudo bash
sudo yum install instrumentald
echo 'nginx = ["http://localhost:80/status"]' > instrumentald.toml
/opt/instrumentald/instrumentald -c instrumentald.toml -k PROJECT_TOKEN

Configuring InstrumentalD

InstrumentalD will collect the metrics below from as many Nginx servers as configured. Here's a basic example of the nginx config:

nginx = ["http://localhost:80/status"]

Everything you need to know about configuring InstrumentalD, including more information about Nginx config, can be found in the InstrumentalD Configuration docs.

Configuring Nginx

Monitoring Nginx with InstrumentalD requires configuring Nginx to use the basic stats module (ngx_http_status_module) when compiled. It's also necessary to add a block similar to the following inside your Nginx server config:

location /status {

Metrics Collected

All Nginx metrics collected by InstrumentalD follow this pattern:

The following metrics are collected:
active The current number of active client connections including Waiting connections.
accepts The total number of accepted client connections.
handled The total number of handled connections. Generally, this is the same as accepts unless some resource limits (e.g. worker_connections) have been reached.
requests The total number of client requests.
reading The current number of connections where nginx is reading the request header.
writing The current number of connections where nginx is writing the response back to the client.
waiting The current number of idle client connections waiting for a request.

How many metrics can I expect from InstrumentalD?

InstrumentalD will collect 7 metrics per Nginx server configured, assuming they have different hostnames.

Questions? We can help!