> ## Documentation Index
> Fetch the complete documentation index at: https://otel.fyi/llms.txt
> Use this file to discover all available pages before exploring further.

# Nginx

> OpenTelemetry receiver for Nginx

# Nginx Receiver

![Status](https://img.shields.io/badge/status-beta-yellow)

**Available in:** `contrib`

**Maintainers:** [@colelaven](https://github.com/colelaven), [@ishleenk17](https://github.com/ishleenk17)

**Source:** [opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/nginxreceiver)

## Supported Telemetry

![Metrics](https://img.shields.io/badge/metrics-beta-green)

## Overview

## Configuration

### NGINX Module

You must configure NGINX to expose status information by editing the NGINX
configuration.  Please see
[ngx\_http\_stub\_status\_module](http://nginx.org/en/docs/http/ngx_http_stub_status_module.html)
for a guide to configuring the NGINX stats module `ngx_http_stub_status_module`.

### Receiver Config

The following settings are required:

* `endpoint` (default: `http://localhost:80/status`): The URL of the NGINX status endpoint

The following settings are optional:

* `collection_interval` (default = `10s`): This receiver collects metrics on an interval. This value must be a string readable by Golang's [time.ParseDuration](https://pkg.go.dev/time#ParseDuration). Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.

* `initial_delay` (default = `1s`): defines how long this receiver waits before starting.

Example:

```yaml theme={null}
receivers:
  nginx:
    endpoint: "http://localhost:80/status"
    collection_interval: 10s
```

The full list of settings exposed for this receiver are documented in [config.go](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/nginxreceiver/config.go)
with detailed sample configurations in [testdata/config.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/nginxreceiver/testdata/config.yaml).

## Metrics

| Metric Name | Description | Unit | Type | Attributes |
| - | - | - | - | - |
| ✅ `nginx.connections_accepted` | The total number of accepted client connections | \{connections} | Counter | |
| ✅ `nginx.connections_current` | The current number of nginx connections by state | \{connections} | UpDownCounter | state |
| ✅ `nginx.connections_handled` | The total number of handled connections. Generally, the parameter value is the same as nginx.connections\_accepted unless some resource limits have been reached (for example, the worker\_connections limit). | \{connections} | Counter | |
| ✅ `nginx.requests` | Total number of requests made to the server since it started | \{requests} | Counter | |

## Attributes

| Attribute Name | Description | Type | Values |
| - | - | - | - |
| `state` | The state of a connection | string | `active`, `reading`, `writing`, `waiting` |

## Configuration

### Example Configuration

```yaml theme={null}
nginx:
  endpoint: "http://localhost:80/status"
  collection_interval: 10s
```

***

*Last generated: 2026-10-05*
