NGINX Exporter Metrics
NGINX Exporter Metrics input plugin scrapes metrics from the NGINX stub status handler.
Configuration Parameters
The plugin supports the following configuration parameters:
Key | Description | Default |
---|---|---|
Host | Name of the target host or IP address to check. | localhost |
Port | Port of the target nginx service to connect to. | 80 |
Status_URL | The URL of the Stub Status Handler. | /status |
Nginx_Plus | Turn on NGINX plus mode. | true |
Threaded | Indicates whether to run this input in its own thread. |
|
Getting Started
NGINX must be configured with a location that invokes the stub status handler. Here is an example configuration with such a location:
Configuration with NGINX Plus REST API
Another metrics API is available with NGINX Plus. You must first configure a path in NGINX Plus.
Command Line
From the command line you can let Fluent Bit generate the checks with the following options:
To gather metrics from the command line with the NGINX Plus REST API we need to turn on the nginx_plus property, like so:
Configuration File
In your main configuration file append the following Input & Output sections:
And for NGINX Plus API:
Testing
You can quickly test against the NGINX server running on localhost by invoking it directly from the command line:
Exported Metrics
This documentation is copied from the NGINX Prometheus Exporter metrics documentation on GitHub.
Common metrics:
Name | Type | Description | Labels |
---|---|---|---|
| Gauge | Shows the status of the last metric scrape: | [] |
Metrics for NGINX OSS:
Name | Type | Description | Labels |
---|---|---|---|
| Counter | Accepted client connections. | [] |
| Gauge | Active client connections. | [] |
| Counter | Handled client connections. | [] |
| Gauge | Connections where NGINX is reading the request header. | [] |
| Gauge | Idle client connections. | [] |
| Gauge | Connections where NGINX is writing the response back to the client. | [] |
| Counter | Total http requests. | [] |
Metrics for NGINX Plus:
Name | Type | Description | Labels |
---|---|---|---|
| Counter | Accepted client connections | [] |
| Gauge | Active client connections | [] |
| Counter | Dropped client connections dropped | [] |
| Gauge | Idle client connections | [] |
Name | Type | Description | Labels |
---|---|---|---|
| Counter | Total http requests | [] |
| Gauge | Current http requests | [] |
Name | Type | Description | Labels |
---|---|---|---|
| Counter | Successful SSL handshakes | [] |
| Counter | Failed SSL handshakes | [] |
| Counter | Session reuses during SSL handshake | [] |
Name | Type | Description | Labels |
---|---|---|---|
| Gauge | Client requests that are currently being processed |
|
| Counter | Total client requests |
|
| Counter | Total responses sent to clients |
|
| Counter | Requests completed without sending a response |
|
| Counter | Bytes received from clients |
|
| Counter | Bytes sent to clients |
|
Name | Type | Description | Labels |
---|---|---|---|
| Gauge | Client connections that are currently being processed |
|
| Counter | Total connections |
|
| Counter | Total sessions completed |
|
| Counter | Connections completed without creating a session |
|
| Counter | Bytes received from clients |
|
| Counter | Bytes sent to clients |
|
Note: for the
state
metric, the string values are converted to float64 using the following rule:"up"
->1.0
,"draining"
->2.0
,"down"
->3.0
,"unavail"
–>4.0
,"checking"
–>5.0
,"unhealthy"
->6.0
.
Name | Type | Description | Labels |
---|---|---|---|
| Gauge | Current state |
|
| Gauge | Active connections |
|
| Gauge | Limit for connections which corresponds to the max_conns parameter of the upstream server. Zero value means there is no limit |
|
| Counter | Total client requests |
|
| Counter | Total responses sent to clients |
|
| Counter | Bytes sent to this server |
|
| Counter | Bytes received to this server |
|
| Counter | Number of unsuccessful attempts to communicate with the server |
|
| Counter | How many times the server became unavailable for client requests (state 'unavail') due to the number of unsuccessful attempts reaching the max_fails threshold |
|
| Gauge | Average time to get the response header from the server |
|
| Gauge | Average time to get the full response from the server |
|
| Gauge | Idle keepalive connections |
|
| Gauge | Servers removed from the group but still processing active client requests |
|
Note: for the
state
metric, the string values are converted to float64 using the following rule:"up"
->1.0
,"down"
->3.0
,"unavail"
–>4.0
,"checking"
–>5.0
,"unhealthy"
->6.0
.
Name | Type | Description | Labels |
---|---|---|---|
| Gauge | Current state |
|
| Gauge | Active connections |
|
| Gauge | Limit for connections which corresponds to the max_conns parameter of the upstream server. Zero value means there is no limit |
|
| Counter | Total number of client connections forwarded to this server |
|
| Gauge | Average time to connect to the upstream server |
|
| Gauge | Average time to receive the first byte of data |
|
| Gauge | Average time to receive the last byte of data |
|
| Counter | Bytes sent to this server |
|
| Counter | Bytes received from this server |
|
| Counter | Number of unsuccessful attempts to communicate with the server |
|
| Counter | How many times the server became unavailable for client connections (state 'unavail') due to the number of unsuccessful attempts reaching the max_fails threshold |
|
| Gauge | Servers removed from the group but still processing active client connections |
|
Name | Type | Description | Labels |
---|---|---|---|
| Counter | Total client requests |
|
| Counter | Total responses sent to clients |
|
| Counter | Requests completed without sending a response |
|
| Counter | Bytes received from clients |
|
| Counter | Bytes sent to clients |
|
Last updated