From 9bcec7917b8838125368ba8f8611117d965d319a Mon Sep 17 00:00:00 2001 From: "Eric D. Schabell" Date: Tue, 9 Dec 2025 18:49:48 +0100 Subject: [PATCH] in_nginx: update NGINX exporter metrics documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add missing scrape_interval parameter (default: 5s) - Add TLS/SSL configuration section - Add info hint about metrics pipeline separation - Alphabetize and lowercase config parameter names - Fix NGINX config comment syntax (// → #) - Standardize indentation to 2 spaces in .conf examples - Minor style improvements for consistency with other input docs Signed-off-by: Eric D. Schabell --- pipeline/inputs/nginx.md | 80 +++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/pipeline/inputs/nginx.md b/pipeline/inputs/nginx.md index ad826a0d9..c01913c49 100644 --- a/pipeline/inputs/nginx.md +++ b/pipeline/inputs/nginx.md @@ -2,21 +2,32 @@ The _NGINX exporter metrics_ input plugin scrapes metrics from the NGINX stub status handler. +{% hint style="info" %} + +Metrics collected with NGINX Exporter Metrics flow through a separate pipeline from logs, and current filters don't operate on top of metrics. + +{% endhint %} + ## Configuration parameters The plugin supports the following configuration parameters: -| Key | Description | Default | -|:-------------|:--------------------------------------------------------------------------------------------------------|:------------| -| `Host` | Name of the target host or IP address. | `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](../../administration/multithreading.md#inputs). | `false` | +| Key | Description | Default | +|:------------------|:--------------------------------------------------------------------------------------------------------|:------------| +| `host` | Name of the target host or IP address. | `localhost` | +| `nginx_plus` | Turn on NGINX Plus mode. | `true` | +| `port` | Port of the target NGINX service to connect to. | `80` | +| `scrape_interval` | The interval to scrape metrics from the NGINX service. | `5s` | +| `status_url` | The URL of the stub status handler. | `/status` | +| `threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` | + +### TLS / SSL + +The NGINX exporter metrics input plugin supports TLS/SSL. For more details about the properties available and general configuration, refer to [Transport Security](../../administration/transport-security.md). ## Get started -NGINX must be configured with a location that invokes the stub status handler. Here is an example configuration with such a location: +NGINX must be configured with a location that invokes the stub status handler. The following is an example configuration with such a location: ```text server { @@ -27,7 +38,7 @@ server { root /usr/share/nginx/html; index index.html index.htm; } - // configure the stub status handler. + # Configure the stub status handler. location /status { stub_status; } @@ -44,12 +55,11 @@ server { listen [::]:80; server_name localhost; - # enable /api/ location with appropriate access control in order - # to make use of NGINX Plus API - # + # Enable /api/ location with appropriate access control in order + # to make use of NGINX Plus API. location /api/ { api write=on; - # configure to allow requests from the server running fluent-bit + # Configure to allow requests from the server running Fluent Bit. allow 192.168.1.*; deny all; } @@ -64,7 +74,7 @@ From the command line you can let Fluent Bit generate the checks with the follow fluent-bit -i nginx_metrics -p host=127.0.0.1 -p port=80 -p status_url=/status -p nginx_plus=off -o stdout ``` -To gather metrics from the command line with the NGINX Plus REST API you need to turn on the +To gather metrics from the command line with the NGINX Plus REST API, turn on the `nginx_plus` property: ```shell @@ -82,10 +92,11 @@ In your main configuration file append the following: pipeline: inputs: - name: nginx_metrics - nginx_plus: off host: 127.0.0.1 port: 80 - status_URL: /status + status_url: /status + nginx_plus: off + scrape_interval: 5s outputs: - name: stdout @@ -97,15 +108,16 @@ pipeline: ```text [INPUT] - Name nginx_metrics - Nginx_Plus off - Host 127.0.0.1 - Port 80 - Status_URL /status + Name nginx_metrics + Host 127.0.0.1 + Port 80 + Status_URL /status + Nginx_Plus off + Scrape_Interval 5s [OUTPUT] - Name stdout - Match * + Name stdout + Match * ``` {% endtab %} @@ -120,10 +132,11 @@ And for NGINX Plus API: pipeline: inputs: - name: nginx_metrics - nginx_plus: on host: 127.0.0.1 port: 80 - status_URL: /api + status_url: /api + nginx_plus: on + scrape_interval: 5s outputs: - name: stdout @@ -135,15 +148,16 @@ pipeline: ```text [INPUT] - Name nginx_metrics - Nginx_Plus on - Host 127.0.0.1 - Port 80 - Status_URL /api + Name nginx_metrics + Host 127.0.0.1 + Port 80 + Status_URL /api + Nginx_Plus on + Scrape_Interval 5s [OUTPUT] - Name stdout - Match * + Name stdout + Match * ``` {% endtab %} @@ -157,7 +171,7 @@ You can test against the NGINX server running on localhost by invoking it direct fluent-bit -i nginx_metrics -p host=127.0.0.1 -p nginx_plus=off -o stdout -p match=* -f 1 ``` -Which should return something like the following: +This returns output similar to the following: ```text ...