You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -6,7 +6,7 @@ NGINX Prometheus exporter makes it possible to monitor NGINX or NGINX Plus using
6
6
7
7
## Overview
8
8
9
-
[NGINX](http://nginx.org) exposes a handful of metrics via the [stub_status page](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status). [NGINX Plus](https://www.nginx.com/products/nginx/) provides a richer set of metrics via the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html) and the [monitoring dashboard](https://www.nginx.com/products/nginx/live-activity-monitoring/). NGINX Prometheus exporter fetches the metrics from a single NGINX or NGINX Plus, converts the metrics into appropriate Prometheus metrics types and finally exposes them via an HTTP server to be collected by [Prometheus](https://prometheus.io/).
9
+
[NGINX](https://nginx.org) exposes a handful of metrics via the [stub_status page](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status). [NGINX Plus](https://www.nginx.com/products/nginx/) provides a richer set of metrics via the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html) and the [monitoring dashboard](https://www.nginx.com/products/nginx/live-activity-monitoring/). NGINX Prometheus exporter fetches the metrics from a single NGINX or NGINX Plus, converts the metrics into appropriate Prometheus metrics types and finally exposes them via an HTTP server to be collected by [Prometheus](https://prometheus.io/).
10
10
11
11
## Getting Started
12
12
@@ -20,7 +20,7 @@ If you’d like to use the NGINX Prometheus Exporter with [NGINX Ingress Control
20
20
21
21
We assume that you have already installed Prometheus and NGINX or NGINX Plus. Additionally, you need to:
22
22
* Expose the built-in metrics in NGINX/NGINX Plus:
23
-
* For NGINX, expose the [stub_status page](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status) at `/stub_status` on port `8080`.
23
+
* For NGINX, expose the [stub_status page](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status) at `/stub_status` on port `8080`.
24
24
* For NGINX Plus, expose the [API](https://nginx.org/en/docs/http/ngx_http_api_module.html#api) at `/api` on port `8080`.
25
25
* Configure Prometheus to scrape metrics from the server with the exporter. Note that the default scrape port of the exporter is `9113` and the default metrics path -- `/metrics`.
26
26
@@ -103,32 +103,149 @@ Usage of ./nginx-prometheus-exporter:
103
103
Display the NGINX exporter version. (default false)
104
104
```
105
105
106
-
### Exported Metrics
107
-
108
-
* Common metrics:
109
-
* `nginxexporter_build_info` -- shows the exporter build information.
110
-
* For NGINX, the following metrics are exported:
111
-
* All [stub_status](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) metrics.
112
-
* `nginx_up` -- shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one.
113
-
114
-
Connect to the `/metrics` page of the running exporter to see the complete list of metrics along with their descriptions.
115
-
* For NGINX Plus, the following metrics are exported:
* [HTTP Server Zones](http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_server_zone).
120
-
* [Stream Server Zones](http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_server_zone).
121
-
* [HTTP Upstreams](http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_upstream). 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`.
122
-
* [Stream Upstreams](http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_upstream). 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`.
123
-
* [Stream Zone Sync](http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_zone_sync).
124
-
* `nginxplus_up` -- shows the status of the last metric scrape: `1` for a successful scrape and `0` for a failed one.
Connect to the `/metrics` page of the running exporter to see the complete list of metrics along with their descriptions. Note: to see server zones related metrics you must configure [status zones](https://nginx.org/en/docs/http/ngx_http_status_module.html#status_zone) and to see upstream related metrics you must configure upstreams with a [shared memory zone](http://nginx.org/en/docs/http/ngx_http_upstream_module.html#zone).
#### [HTTP Server Zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_server_zone)
149
+
Name | Type | Description | Labels
150
+
----|----|----|----|
151
+
`nginxplus_server_zone_processing` | Gauge | Client requests that are currently being processed | `server_zone` |
152
+
`nginxplus_server_zone_requests` | Counter | Total client requests | `server_zone` |
153
+
`nginxplus_server_zone_responses` | Counter | Total responses sent to clients | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `server_zone` |
154
+
`nginxplus_server_zone_discarded` | Counter | Requests completed without sending a response | `server_zone` |
155
+
`nginxplus_server_zone_received` | Counter | Bytes received from clients | `server_zone` |
156
+
`nginxplus_server_zone_sent` | Counter | Bytes sent to clients | `server_zone` |
157
+
158
+
#### [Stream Server Zones](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_server_zone)
159
+
Name | Type | Description | Labels
160
+
----|----|----|----|
161
+
`nginxplus_stream_server_zone_processing` | Gauge | Client connections that are currently being processed | `server_zone` |
162
+
`nginxplus_stream_server_zone_connections` | Counter | Total connections | `server_zone` |
163
+
`nginxplus_stream_server_zone_sessions` | Counter | Total sessions completed | `code` (the response status code. The values are: `2xx`, `4xx`, and `5xx`), `server_zone` |
164
+
`nginxplus_stream_server_zone_discarded` | Counter | Connections completed without creating a session | `server_zone` |
165
+
`nginxplus_stream_server_zone_received` | Counter | Bytes received from clients | `server_zone` |
166
+
`nginxplus_stream_server_zone_sent` | Counter | Bytes sent to clients | `server_zone` |
> 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`.
171
+
172
+
Name | Type | Description | Labels
173
+
----|----|----|----|
174
+
`nginxplus_upstream_server_state` | Gauge | Current state | `server`, `upstream` |
175
+
`nginxplus_upstream_server_active` | Gauge | Active connections | `server`, `upstream` |
`nginxplus_upstream_server_responses` | Counter | Total responses sent to clients | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `server`, `upstream` |
178
+
`nginxplus_upstream_server_sent` | Counter | Bytes sent to this server | `server`, `upstream` |
179
+
`nginxplus_upstream_server_received` | Counter | Bytes received to this server | `server`, `upstream` |
180
+
`nginxplus_upstream_server_fails` | Counter | Number of unsuccessful attempts to communicate with the server | `server`, `upstream` |
181
+
`nginxplus_upstream_server_unavail` | 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 | `server`, `upstream` |
182
+
`nginxplus_upstream_server_header_time` | Gauge | Average time to get the response header from the server | `server`, `upstream` |
183
+
`nginxplus_upstream_server_response_time` | Gauge | Average time to get the full response from the server | `server`, `upstream` |
184
+
`nginxplus_upstream_server_health_checks_checks` | Counter | Total health check requests | `server`, `upstream` |
`nginxplus_upstream_server_health_checks_unhealthy` | Counter | How many times the server became unhealthy (state 'unhealthy') | `server`, `upstream` |
> 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`.
193
+
194
+
Name | Type | Description | Labels
195
+
----|----|----|----|
196
+
`nginxplus_stream_upstream_server_state` | Gauge | Current state | `server`, `upstream` |
`nginxplus_stream_upstream_server_connections` | Counter | Total number of client connections forwarded to this server | `server`, `upstream` |
199
+
`nginxplus_stream_upstream_server_connect_time` | Gauge | Average time to connect to the upstream server | `server`, `upstream`
200
+
`nginxplus_stream_upstream_server_first_byte_time` | Gauge | Average time to receive the first byte of data | `server`, `upstream` |
201
+
`nginxplus_stream_upstream_server_response_time` | Gauge | Average time to receive the last byte of data | `server`, `upstream` |
202
+
`nginxplus_stream_upstream_server_sent` | Counter | Bytes sent to this server | `server`, `upstream` |
203
+
`nginxplus_stream_upstream_server_received` | Counter | Bytes received from this server | `server`, `upstream` |
204
+
`nginxplus_stream_upstream_server_fails` | Counter | Number of unsuccessful attempts to communicate with the server | `server`, `upstream` |
205
+
`nginxplus_stream_upstream_server_unavail` | 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 | `server`, `upstream` |
206
+
`nginxplus_stream_upstream_server_health_checks_checks` | Counter | Total health check requests | `server`, `upstream` |
`nginxplus_stream_upstream_server_health_checks_unhealthy` | Counter | How many times the server became unhealthy (state 'unhealthy') | `server`, `upstream` |
209
+
`nginxplus_stream_upstream_zombies` | Gauge | Servers removed from the group but still processing active client connections | `upstream`|
210
+
211
+
#### [Stream Zone Sync](https://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_stream_zone_sync)
212
+
Name | Type | Description | Labels
213
+
----|----|----|----|
214
+
`nginxplus_stream_zone_sync_zone_records_pending` | Gauge | The number of records that need to be sent to the cluster | `zone` |
215
+
`nginxplus_stream_zone_sync_zone_records_total` | Gauge | The total number of records stored in the shared memory zone | `zone` |
216
+
`nginxplus_stream_zone_sync_zone_bytes_in` | Counter | Bytes received by this node | [] |
217
+
`nginxplus_stream_zone_sync_zone_bytes_out` | Counter | Bytes sent by this node | [] |
218
+
`nginxplus_stream_zone_sync_zone_msgs_in` | Counter | Total messages received by this node | [] |
219
+
`nginxplus_stream_zone_sync_zone_msgs_out` | Counter | Total messages sent by this node | [] |
220
+
`nginxplus_stream_zone_sync_zone_nodes_online` | Gauge | Number of peers this node is connected to | [] |
`nginxplus_location_zone_requests` | Counter | Total client requests | `location_zone` |
226
+
`nginxplus_location_zone_responses` | Counter | Total responses sent to clients | `code` (the response status code. The values are: `1xx`, `2xx`, `3xx`, `4xx` and `5xx`), `location_zone` |
227
+
`nginxplus_location_zone_discarded` | Counter | Requests completed without sending a response | `location_zone` |
228
+
`nginxplus_location_zone_received` | Counter | Bytes received from clients | `location_zone` |
229
+
`nginxplus_location_zone_sent` | Counter | Bytes sent to clients | `location_zone` |
`nginxplus_resolver_name` | Counter | Total requests to resolve names to addresses | `resolver` |
235
+
`nginxplus_resolver_srv` | Counter | Total requests to resolve SRV records | `resolver` |
236
+
`nginxplus_resolver_addr` | Counter | Total requests to resolve addresses to names | `resolver` |
237
+
`nginxplus_resolver_noerror` | Counter | Total number of successful responses | `resolver` |
238
+
`nginxplus_resolver_formerr` | Counter | Total number of FORMERR responses | `resolver` |
239
+
`nginxplus_resolver_servfail` | Counter | Total number of SERVFAIL responses | `resolver` |
240
+
`nginxplus_resolver_nxdomain` | Counter | Total number of NXDOMAIN responses | `resolver` |
241
+
`nginxplus_resolver_notimp` | Counter | Total number of NOTIMP responses | `resolver` |
242
+
`nginxplus_resolver_refused` | Counter | Total number of REFUSED responses | `resolver` |
243
+
`nginxplus_resolver_timedout` | Counter | Total number of timed out request | `resolver` |
244
+
`nginxplus_resolver_unknown` | Counter | Total requests completed with an unknown error | `resolver`|
245
+
246
+
Connect to the `/metrics` page of the running exporter to see the complete list of metrics along with their descriptions. Note: to see server zones related metrics you must configure [status zones](https://nginx.org/en/docs/http/ngx_http_status_module.html#status_zone) and to see upstream related metrics you must configure upstreams with a [shared memory zone](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#zone).
247
+
248
+
## Troubleshooting
132
249
133
250
The exporter logs errors to the standard output. When using Docker, if the exporter doesn’t work as expected, check its logs using [docker logs](https://docs.docker.com/engine/reference/commandline/logs/) command.
0 commit comments