ObserveNow
...
Integrations
Infrastructure

Nginx

Single Machine

The Prometheus Nginx exporter can be used on a standalone machine to collect metrics from an nginx server.

Prerequisite(s)

OpsVerse Single Machine agent

The OpsVerse single machine agent should be running on this machine. If that's not the case, it can be installed using these steps.

stub_status module

The Nginx server should have the stub_status module enabled for the metrics collection to work. Availability of this module can be checked by running this command:

Shell


If this module is not already enabled, it can be enabled by following the steps outlined in this document.

Add a location for stub_status

Update the nginx.conf file and add a location for the stub_status module. This enables the nginx server to return metrics on the configured location URI. Here is an example:

Lua


For more details, please see - Nginx metrics through stub_status.

Install Nginx Prometheus Metric Exporter

The nginx prometheus exporter can be installed using this command:

Shell


The agent will begin scraping the metrics automatically. The script will drop the scrape target into /etc/opsverse/targets/, so the agent will begin automatically scraping.