Monitor NGINX with OpenTelemetry
Osuite monitors NGINX through the OpenTelemetry Collector’s nginx receiver, which scrapes the stub_status endpoint and exports connection and request metrics over OTLP. They share resource attributes with your services, so a request surge in APM lines up with the reverse proxy in front of it.
Prerequisites
Section titled “Prerequisites”- NGINX built with the
ngx_http_stub_status_module(included in the standard packages). - A
stub_statusendpoint the Collector can reach.
Add a status location to your NGINX configuration and reload:
server { listen 80;
location /status { stub_status on; allow 127.0.0.1; deny all; }}Reload NGINX and confirm the endpoint responds:
nginx -s reloadcurl http://localhost/statusConfigure the Collector
Section titled “Configure the Collector”-
Add the
nginxreceiver, theotlp/osuiteexporter, and a metrics pipeline. Pick the tab that matches where your Collector runs — only the receiverendpointchanges.receivers:nginx:endpoint: http://localhost:80/statuscollection_interval: 30sprocessors:batch:resourcedetection:exporters:otlp/osuite:endpoint: ingest.<region>.osuite.io:443headers:x-osuite-ingest-token: <your-ingest-token>service:pipelines:metrics:receivers: [nginx]processors: [batch, resourcedetection]exporters: [otlp/osuite]receivers:nginx:endpoint: http://nginx:80/statuscollection_interval: 30sprocessors:batch:resourcedetection:exporters:otlp/osuite:endpoint: ingest.<region>.osuite.io:443headers:x-osuite-ingest-token: <your-ingest-token>service:pipelines:metrics:receivers: [nginx]processors: [batch, resourcedetection]exporters: [otlp/osuite]receivers:nginx:endpoint: http://nginx.default.svc.cluster.local:80/statuscollection_interval: 30sprocessors:batch:resourcedetection:exporters:otlp/osuite:endpoint: ingest.<region>.osuite.io:443headers:x-osuite-ingest-token: <your-ingest-token>service:pipelines:metrics:receivers: [nginx]processors: [batch, resourcedetection]exporters: [otlp/osuite] -
Start the Collector. On Docker and Kubernetes, the Collector and NGINX must share a network so the
endpointresolves.
Validate
Section titled “Validate”What you should see
Metrics named nginx.* appear in Dashboards → Explore metrics within a minute, tagged with the host or pod the Collector runs on.
Data collected
Section titled “Data collected”| Metric | Description | Unit |
|---|---|---|
nginx.requests | Total requests served since start | {requests} |
nginx.connections_accepted | Accepted client connections | {connections} |
nginx.connections_handled | Handled connections (equal to accepted unless limits apply) | {connections} |
nginx.connections_current | Current connections by state (active, reading, writing, waiting) | {connections} |
stub_status exposes a small, fixed set of counters. For richer per-request latency and status-code metrics, generate NGINX access logs and collect them as logs.
Dashboards and alerts
Section titled “Dashboards and alerts”Once metrics arrive, build an NGINX dashboard in the dashboard builder from the series above. Alerts in Osuite are PromQL-based — see Alerts. Useful starting conditions: a request-rate drop to zero (nginx.requests), and a rising active-connection count (nginx.connections_current) that signals backpressure.
Troubleshooting
Section titled “Troubleshooting”- 403 or connection refused on
/status— confirm thestub_statuslocation exists and itsallowlist covers the Collector’s source address. - Wrong module — confirm
nginx -Vlists--with-http_stub_status_module.
No data in Osuite after a few minutes? Work through these checks.
- Endpoint — confirm the exporter targets exactly
ingest.<region>.osuite.io:443for your region, over TLS. - Token — confirm the ingest header carries a valid
<your-ingest-token>and has not been rotated. - Pipeline — confirm the signal you expect (traces, logs, or metrics) is wired into an active pipeline with the
otlp/osuiteexporter attached. - Export errors — check the application or Collector logs for OTLP export failures (auth, DNS, TLS, connection refused).
- Network — confirm the host has outbound access to the ingest endpoint on port
443. - Timing — allow up to a minute for the first data to appear before assuming a failure.
Still stuck? Ask the Investigation Agent or contact support.