---
title: NGINX OpenTelemetry metrics and attributes reference
source: https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/nginx-otel-metrics-reference
---

This reference covers all metrics and attributes collected by the OpenTelemetry NGINX receiver, applicable to both on-host and Kubernetes deployments.

## Core NGINX metrics [#core-metrics]

The OpenTelemetry Collector Contrib's [nginxreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/nginxreceiver) collects the following metrics from the NGINX stub status module:

| Metric                       | Description                                                                                                                                                                                                                                                                    | Type |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- |
| `nginx.connections_accepted` | The total number of accepted client connections. Use this to track connection acceptance rates over time.                                                                                                                                                                      | Sum  |
| `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). A gap between accepted and handled suggests resource constraints. | Sum  |
| `nginx.connections_current`  | The current number of nginx connections by state. States include: active (total active connections), reading (reading request headers), writing (writing responses), waiting (keep-alive connections waiting for next request).                                                | Sum  |
| `nginx.requests`             | Total number of requests made to the server since it started. Use rate calculations to derive requests per second for performance monitoring.                                                                                                                                  | Sum  |

**Capacity planning tips:**

-   High `waiting` connections may indicate keep-alive tuning opportunities
-   Gap between `accepted` and `handled` connections suggests resource constraints
-   Request-to-connection ratios help optimize worker configurations

## Resource attributes [#resource-attributes]

Resource attributes provide context about your NGINX deployment and vary depending on whether you're using on-host or Kubernetes deployment.

### Common attributes [#common-attributes]

| Attribute               | Description                                                                  | Example Values                            |
| ----------------------- | ---------------------------------------------------------------------------- | ----------------------------------------- |
| `state`                 | The state of a connection (applicable to `nginx.connections_current` metric) | `active`, `reading`, `writing`, `waiting` |
| `nginx.server.endpoint` | The NGINX stub status endpoint URL                                           | `http://localhost:8080/stub_status`       |

### On-host deployment attributes [#on-host-attributes]

| Attribute               | Description                                                                                                                                                                                                                                           | Example Values                                            |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `nginx.deployment.name` | A unique name to identify this NGINX deployment                                                                                                                                                                                                       | `production-web-01`, `staging-api`                        |
| `nginx.display.name`    | A display-friendly name combining "server" prefix with deployment name                                                                                                                                                                                | `server:production-web-01`                                |
| `host.name`             | The hostname of the system where NGINX is running                                                                                                                                                                                                     | `web-server-01.example.com`                               |
| `host.id`               | The unique identifier of the host system                                                                                                                                                                                                              | `i-1234567890abcdef0`                                     |
| `logtype`               | The type of log being collected (applicable to logs only). Used by New Relic's built-in [parsing rules](https://docs.newrelic.com/docs/logs/ui-data/built-log-parsing-rules/#nginx). This attribute is only available when log forwarding is enabled. | `nginx` (for access logs), `nginx-error` (for error logs) |

### Kubernetes deployment attributes [#kubernetes-attributes]

| Attribute               | Description                                                                    | Example Values                                                                     |
| ----------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| `k8s.cluster.name`      | The name of the Kubernetes cluster                                             | `nginx-cluster`, `production-k8s`                                                  |
| `k8s.namespace.name`    | The Kubernetes namespace where the NGINX pod is running                        | `default`, `web-services`, `production`                                            |
| `k8s.pod.name`          | The name of the Kubernetes pod running NGINX                                   | `nginx-deployment-7d4b8c6f9-x5z8w`                                                 |
| `nginx.deployment.name` | Set to the pod name for Kubernetes deployments                                 | `nginx-deployment-7d4b8c6f9-x5z8w`                                                 |
| `nginx.display.name`    | A comprehensive display name including cluster, namespace, and pod information | `server:k8s:nginx-cluster:default:pod:nginx-deployment-7d4b8c6f9-x5z8w:nginx:8080` |

## Metric collection details [#collection-details]

### Collection frequency

-   **Default interval**: 30 seconds
-   **Configurable**: Can be adjusted in the OpenTelemetry Collector configuration

### Data source

All metrics are collected from the NGINX [stub_status module](https://nginx.org/en/docs/http/ngx_http_stub_status_module.html), which must be enabled and configured to expose an HTTP endpoint.

### Metric types

-   **Sum metrics**: Cumulative values that represent totals over time
-   **Rate calculations**: Use New Relic's `rate()` function to convert cumulative metrics to per-second rates for monitoring

## Related documentation [#related-docs]

**Setup guides:**

-   [Monitor NGINX on self-hosted environments](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/nginx-otel-host/) - Complete setup for on-host deployments
-   [Monitor NGINX on Kubernetes](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/nginx-otel-kubernetes/) - Complete setup for Kubernetes deployments

**Data usage:**

-   [Find and query your NGINX data](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/find-and-query-your-data/) - Dashboards, NRQL queries, and alerts

**Technical reference:**

-   [NGINX receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/nginxreceiver/documentation.md) - OpenTelemetry technical details
