---
title: Monitor self-hosted NGINX Plus with OpenTelemetry
source: https://docs.newrelic.com/docs/opentelemetry/integrations/nginx-plus/nginx-plus-otel
---

Monitor your NGINX Plus servers running on a host using the [NRDOT collector](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/latest) (recommended) or [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-contrib) to send metrics and telemetry data to New Relic.

This integration leverages the OpenTelemetry [prometheusreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver) and [nginx-prometheus-exporter](https://github.com/nginx/nginx-prometheus-exporter) to monitor your NGINX Plus performance metrics, connection statistics, and server health. The rich HTTP API in NGINX Plus provides significantly more detailed metrics compared to the basic stub status module in standard NGINX.

![Image of the NGINX dashboard](https://docs.newrelic.com/images/opentelemetry_screenshot-nginx-dashboard.webp "NGINX dashboard")

Dashboard available through the [New Relic NGINX OpenTelemetry Monitor quickstart](https://newrelic.com/instant-observability/nginx-opentelemetry).

## Before you begin [#prerequisites]

Ensure you have:

-   Valid New Relic [license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#ingest-license-key)
-   NGINX Plus version [R13](https://docs.nginx.com/nginx/releases/#r13) or higher
-   NGINX Plus with the [HTTP API](https://nginx.org/en/docs/http/ngx_http_api_module.html) module enabled
-   [NGINX Prometheus exporter](https://github.com/nginx/nginx-prometheus-exporter) installed and running alongside your NGINX Plus instance to expose HTTP API metrics in Prometheus format
-   One of the following collectors installed on a Linux host:
    -   [NRDOT collector](https://github.com/newrelic/nrdot-collector-releases/blob/main/distributions/README.md#deb-installation) (recommended - New Relic's OpenTelemetry distribution), or
    -   [OpenTelemetry Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/latest) (alternative option)
-   Network access from the Linux host to:
    -   NGINX Plus HTTP API endpoint
    -   A [New Relic OTLP](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol) endpoint

/\* ### Verify your setup



Check NGINX Plus version:
\`\`\`bash
nginx -V 2>&1 | grep -o "nginx/\[0-9.]\*"
\`\`\`
Expected output: \`nginx/1.25.0\` or higher (R13+)



Test network connectivity:
\`\`\`bash
\# For US region (default)
curl -I https&#x3A;//otlp.nr-data.net:4318/v1/metrics
\# For EU region
curl -I https&#x3A;//otlp.eu01.nr-data.net:4318/v1/metrics
\# For JP region
curl -I https&#x3A;//otlp.jp.nr-data.net:4318/v1/metrics
\`\`\`
Expected output: HTTP/2 200 response


 \*/

## Set up NGINX Plus monitoring [#setup]

Choose your preferred collector and follow the configuration steps:

### NRDOT collector

> #### 💡 TIP
>
> If any verification step fails, install the missing components before continuing. Need help installing the NRDOT collector? Check the [installation section](https://github.com/newrelic/nrdot-collector-releases/blob/main/distributions/README.md#deb-installation) of the nrdot-collector-releases repository.
>
> During installation use `export collector_distro="nrdot-collector"`

#### Configure the NRDOT collector [#configure-nrdot-collector]

Configure the NRDOT collector to scrape metrics from your NGINX Plus Prometheus exporter and send them to New Relic.

**Step 1: Configure collector configuration**

For NRDOT collector, create a standalone NGINX Plus monitoring configuration file that replaces the default configuration.

> #### ⚠️ IMPORTANT
>
> **Standalone vs. Combined monitoring**: This configuration monitors NGINX Plus servers only. If you also need host metrics (CPU, memory, disk) or system logs, use the NRDOT collector's [default configuration](https://github.com/newrelic/nrdot-collector-releases/blob/main/distributions/nrdot-collector/config.yaml) which includes the `hostmetrics` and `filelog` receivers, and add the `prometheus` receiver to it.

Create `/etc/nrdot-collector/nginx-plus-config.yaml` with the following content:

```yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: 'nginx-plus'
          scrape_interval: 30s
          static_configs:
            - targets: ['<YOUR_PROMETHEUS_EXPORTER_ENDPOINT>']
processors:
  batch:
    send_batch_size: 1024
    timeout: 30s
  filter/nginx_metrics:
    metrics:
      include:
        match_type: regexp
        metric_names:
          - "nginxplus_connections_.*"
          - "nginxplus_http_requests_.*"
          - "nginxplus_ssl_.*"
      exclude:
        match_type: regexp
        metric_names:
          - "nginxplus_server_.*"
          - "nginxplus_location_zone_.*"
          - "nginxplus_cache_.*"
          - "nginxplus_stream_server_.*"
          - "nginxplus_upstream_.*"
          - "nginxplus_stream_upstream_.*"
          - "nginxplus_stream_zone_sync_zone_.*"
          - "nginxplus_resolver_.*"
          - "nginxplus_limit_request_.*"
          - "nginxplus_limit_connection_.*"
          - "nginxplus_stream_limit_connection_.*"
          - "nginxplus_worker_.*"
  resource/nginx:
    attributes:
      - key: nginx.server.endpoint
        value: "<YOUR_API_STATUS_ENDPOINT>"  # Replace with your endpoint
        action: insert
      - key: nginx.deployment.name
        value: "<DEPLOYMENT_NAME>"                    # Replace with your deployment server name
        action: insert
  resourcedetection:
    detectors: [system]
    system:
      resource_attributes:
        host.name:
          enabled: true
        host.id:
          enabled: true
  transform/nginx:
    metric_statements:
      - context: resource
        statements:
          - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
      - context: resource
        statements:
          - delete_key(attributes, "service.name")
  transform/metadata_nullify:
    metric_statements:
      - context: metric
        statements:
          - set(description, "")
          - set(unit, "")
exporters:
  otlp_http:
    endpoint: ${env:YOUR_NEWRELIC_OTLP_ENDPOINT}
    headers:
      api-key: ${env:YOUR_NEW_RELIC_LICENSE_KEY}
service:
  pipelines:
    metrics/nginx:
      receivers: [prometheus]
      processors: [batch, filter/nginx_metrics, resourcedetection, resource/nginx, transform/nginx, transform/metadata_nullify]
      exporters: [otlp_http]
```

##### Configuration parameters

The following table describes the key configuration parameters:

| Parameter                             | Description                                                                                                                     |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `<YOUR_PROMETHEUS_EXPORTER_ENDPOINT>` | Replace with the prometheus exporter endpoint (for example '127.0.0.1:9113')                                                    |
| `<YOUR_API_STATUS_ENDPOINT>`          | Replace with the api status endpoint of the NGINX Plus server (for example http&#x3A;/127.0.0.1/api/9)                          |
| `<DEPLOYMENT_NAME>`                   | Replace with a unique deployment name for this NGINX Plus server (for example `production-web-01`, `staging-api`, `prod-lb-01`) |
| `scrape_interval`                     | Interval in seconds to collect metrics. The default value is set to `30s`                                                       |
| `send_batch_size`                     | Number of metrics to batch before sending. The default value is set to `1024`                                                   |
| `timeout`                             | Timeout in seconds to wait before sending batched metrics. The default value is set to `30s`                                    |

**Step 2: (Optional) Enable additional metrics**

By default, the configuration collects only core metrics (connections, HTTP requests, and SSL). To enable additional metric categories:

1.  Identify the metrics you want to enable from the [metrics list](#metrics) below and note which category they belong to.

2.  Move the corresponding metric prefix from `exclude` to `include` in the `filter/nginx_metrics` processor.

    Example: Enable HTTP Server Zones metrics

3.  Find this line in the `exclude` section:
    ```yaml
    filter/nginx_metrics:
      metrics:
        include:
        # existing include metrics
        exclude:
          match_type: regexp
          metric_names:
            - "nginxplus_server_.*"
    ```

4.  Move it to the `include` section:
    ```yaml
    filter/nginx_metrics:
      metrics:
        include:
          match_type: regexp
          metric_names:
            - "nginxplus_connections_.*"
            - "nginxplus_http_requests_.*"
            - "nginxplus_ssl_.*"
            - "nginxplus_server_.*"  # Added to enable server zone metrics
        exclude:
          match_type: regexp
          metric_names:
            # Remove "nginxplus_server_.*" from here
            - "nginxplus_location_zone_.*"
            - "nginxplus_cache_.*"
            # ... rest of exclude list
    ```

5.  Restart the collector after making changes:
    ```bash
    sudo systemctl restart nrdot-collector.service
    ```

#### Configure environment and update config path [#set-environment-nrdot]

Update the NRDOT collector configuration to use your NGINX Plus config file and set the OTLP endpoint.

Determine your OTLP endpoint based on your New Relic region. See [Configure endpoint, port, and protocol](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol) for the complete list of endpoints and supported ports for your region.

> #### ⚠️ IMPORTANT
>
> Your license key was already configured in `/etc/nrdot-collector/nrdot-collector.conf` during installation. You only need to update the config file path and OTLP endpoint.

Update the collector configuration file:

```bash
export collector_distro="nrdot-collector"
export otlp_endpoint="YOUR_NEWRELIC_OTLP_ENDPOINT"  # Replace with your region's endpoint

# Update the config file path to point to nginx-plus-config.yaml
sudo sed -i 's|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/config.yaml"|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/nginx-plus-config.yaml"|' /etc/${collector_distro}/${collector_distro}.conf

# Add the OTLP endpoint
echo "OTEL_EXPORTER_OTLP_ENDPOINT=${otlp_endpoint}" | sudo tee -a /etc/${collector_distro}/${collector_distro}.conf > /dev/null
```

#### (Optional) Forward NGINX logs [#forward-logs-nrdot]

Extend your collector configuration to include access and error logs if you want log events alongside metrics.

**Step 1: Configure NGINX Plus log format**

Before forwarding logs, configure NGINX Plus to use a structured log format. Refer to the [NGINX logging documentation](https://docs.nginx.com/nginx/admin-guide/monitoring/logging/) for guidance on configuring access and error logs.

**Step 2: Configure the NRDOT collector for log forwarding**

1.  Note the full paths to your NGINX access and error log files. Defaults are usually `/var/log/nginx/access.log` and `/var/log/nginx/error.log`.

2.  Update `/etc/nrdot-collector/nginx-plus-config.yaml` to add a `filelog` receiver and log pipeline:

    ```yaml
    receivers:
      prometheus:
        # existing Prometheus receiver configuration
      filelog/nginx_access_logs:
        include:
          - /var/log/nginx/access.log
      filelog/nginx_error_logs:
        include:
          - /var/log/nginx/error.log

    processors:
      batch:
        # existing settings
      filter/nginx_metrics:
        # existing settings
      resourcedetection:
        # existing settings
      resource/nginx:
        # existing settings
      transform/nginx_metrics:
        # existing settings
      transform/nginx_access_logs:
        log_statements:
          - context: resource
            statements:
              - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
              - set(attributes["logtype"], "nginx")
      transform/nginx_error_logs:
        log_statements:
          - context: resource
            statements:
              - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
              - set(attributes["logtype"], "nginx-error")

    exporters:
      # existing exporter setup

    service:
      pipelines:
        # Your existing metrics pipeline...

        # Add log pipelines
        logs/nginx-access:
          receivers: [filelog/nginx_access_logs]
          processors: [batch, resource/nginx, transform/nginx_access_logs]
          exporters: [otlp_http]
        logs/nginx-error:
          receivers: [filelog/nginx_error_logs]
          processors: [batch, resource/nginx, transform/nginx_error_logs]
          exporters: [otlp_http]
    ```

3.  Grant the collector user read access to the log files:

    ```bash
    sudo usermod -a -G adm nrdot-collector
    sudo chmod 644 /var/log/nginx/access.log
    sudo chmod 644 /var/log/nginx/error.log
    ```

4.  Restart the collector to apply the changes:

    ```bash
    sudo systemctl restart nrdot-collector
    ```

#### Start monitoring [#start-monitoring-nrdot]

Now that everything is configured, start the NRDOT collector and verify that data is flowing to New Relic.

**Step 1: Start the collector**

1.  Apply the configuration changes:
    ```bash
    sudo systemctl daemon-reload
    sudo systemctl restart nrdot-collector.service
    ```

2.  Verify the service is running:
    ```bash
    sudo systemctl status nrdot-collector.service
    ```
    Expected output: `Active: active (running)` with no recent errors

**Step 2: Verify data collection**

3.  Check startup logs:
    ```bash
    sudo journalctl -u nrdot-collector.service -n 20
    ```

4.  Generate test traffic (to create metrics):
    ```bash
    # Make a few requests to your NGINX Plus server
    curl http://localhost
    ```

5.  Allow time for initial data to appear in New Relic, then access your [NGINX dashboard](#find-data) to verify data collection.

### OpenTelemetry Collector Contrib

> #### 💡 TIP
>
> If any verification step fails, install the missing components before continuing. Need help installing the collector? Check the [OpenTelemetry Collector installation guide](https://github.com/open-telemetry/opentelemetry-collector-contrib).

#### Configure the OpenTelemetry Collector [#configure-otelcol-collector]

Configure the OpenTelemetry Collector to scrape metrics from your NGINX Plus Prometheus exporter and send them to New Relic.

**Step 1: Configure collector configuration**

> #### ⚠️ IMPORTANT
>
> **Before editing:** Back up your existing configuration: `sudo cp /etc/otelcol-contrib/config.yaml /etc/otelcol-contrib/config.yaml.backup`

Edit your collector configuration file (typically `/etc/otelcol-contrib/config.yaml`) and add the following sections. If you already have receivers, processors, or exporters sections, merge these with your existing configuration:

```yaml
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: 'nginx-plus'
          scrape_interval: 30s
          static_configs:
            - targets: ['<YOUR_PROMETHEUS_EXPORTER_ENDPOINT>']
processors:
  batch:
    send_batch_size: 1024
    timeout: 30s
  filter/nginx_metrics:
    metrics:
      include:
        match_type: regexp
        metric_names:
          - "nginxplus_connections_.*"
          - "nginxplus_http_requests_.*"
          - "nginxplus_ssl_.*"
      exclude:
        match_type: regexp
        metric_names:
          - "nginxplus_server_.*"
          - "nginxplus_location_zone_.*"
          - "nginxplus_cache_.*"
          - "nginxplus_stream_server_.*"
          - "nginxplus_upstream_.*"
          - "nginxplus_stream_upstream_.*"
          - "nginxplus_stream_zone_sync_zone_.*"
          - "nginxplus_resolver_.*"
          - "nginxplus_limit_request_.*"
          - "nginxplus_limit_connection_.*"
          - "nginxplus_stream_limit_connection_.*"
          - "nginxplus_worker_.*"
  resource/nginx:
    attributes:
      - key: nginx.server.endpoint
        value: "<YOUR_API_STATUS_ENDPOINT>"  # Replace with your endpoint
        action: insert
      - key: nginx.deployment.name
        value: "<DEPLOYMENT_NAME>"                    # Replace with your deployment name
        action: insert
  resourcedetection:
    detectors: [system]
    system:
      resource_attributes:
        host.name:
          enabled: true
        host.id:
          enabled: true
  transform/nginx:
    metric_statements:
      - context: resource
        statements:
          - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
      - context: resource
        statements:
          - delete_key(attributes, "service.name")
  transform/metadata_nullify:
    metric_statements:
      - context: metric
        statements:
          - set(description, "")
          - set(unit, "")
exporters:
  otlp_http:
    endpoint: ${env:YOUR_NEWRELIC_OTLP_ENDPOINT}
    headers:
      api-key: ${env:YOUR_NEW_RELIC_LICENSE_KEY}
service:
  pipelines:
    metrics/nginx:
      receivers: [prometheus]
      processors: [batch, filter/nginx_metrics, resourcedetection, resource/nginx, transform/nginx, transform/metadata_nullify]
      exporters: [otlp_http]
```

##### Configuration parameters

The following table describes the key configuration parameters:

| Parameter                             | Description                                                                                                                     |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `<YOUR_PROMETHEUS_EXPORTER_ENDPOINT>` | Replace with the prometheus exporter endpoint (for example '127.0.0.1:9113')                                                    |
| `<YOUR_API_STATUS_ENDPOINT>`          | Replace with the api status endpoint of the NGINX Plus server (for example http&#x3A;/127.0.0.1/api/9)                          |
| `<DEPLOYMENT_NAME>`                   | Replace with a unique deployment name for this NGINX Plus server (for example `production-web-01`, `staging-api`, `prod-lb-01`) |
| `scrape_interval`                     | Interval to collect metrics. The default value is set to `30s`                                                                  |
| `send_batch_size`                     | Number of metrics to batch before sending. The default value is set to `1024`                                                   |
| `timeout`                             | Maximum time to wait before sending a batch. The default value is set to `30s`                                                  |
| `nginx.display.name`                  | Display name format for NGINX server in New Relic (automatically generated as "server:`<DEPLOYMENT_NAME>`")                     |

**Step 2: (Optional) Enable additional metrics**

By default, the configuration collects only core metrics (connections, HTTP requests, and SSL). To enable additional metric categories like server zones, location zones, or cache metrics:

1.  Identify the metrics you want to enable from the [metrics list](#metrics) below. Note which category they belong to (e.g., HTTP Server Zones, Location Zones, Cache).

2.  Move the corresponding metric prefix from `exclude` to `include` in the `filter/nginx_metrics` processor.

    Example: Enable HTTP Server Zones metrics

    Find this line in the `exclude` section:

    ```yaml
    filter/nginx_metrics:
      metrics:
        include:
        # existing include metrics
        exclude:
          match_type: regexp
          metric_names:
            - "nginxplus_server_.*"
    ```

    Move it to the `include` section:

    ```yaml
    filter/nginx_metrics:
      metrics:
        include:
          match_type: regexp
          metric_names:
            - "nginxplus_connections_.*"
            - "nginxplus_http_requests_.*"
            - "nginxplus_ssl_.*"
            - "nginxplus_server_.*"  # Added to enable server zone metrics
        exclude:
          match_type: regexp
          metric_names:
            # Remove "nginxplus_server_.*" from here
            - "nginxplus_location_zone_.*"
            - "nginxplus_cache_.*"
            # ... rest of exclude list
    ```

3.  Restart the collector after making changes:
    ```bash
    sudo systemctl restart otelcol-contri.service
    ```

#### Set up authentication [#set-environment-otelcol]

Configure secure authentication so the OpenTelemetry Collector can send data to your New Relic account. This step sets up environment variables to keep your credentials secure.

1.  Get your New Relic credentials:

    -   License Key: Get your license key from the [API Keys UI page](https://one.newrelic.com/admin-portal/api-keys/home)
    -   OTLP Endpoint: Use your region's endpoint from [New Relic OTLP endpoints](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol)

2.  Configure the credentials:

    1.  Create a systemd override directory:

        ```bash
        export collector_distro="otelcol-contrib"
        sudo mkdir -p /etc/systemd/system/${collector_distro}.service.d
        ```

    2.  Create the environment configuration file:

        ```bash
        cat <<EOF | sudo tee /etc/systemd/system/${collector_distro}.service.d/environment.conf
        [Service]
        Environment="NEWRELIC_OTLP_ENDPOINT=<`YOUR_NEWRELIC_OTLP_ENDPOINT>`"
        Environment="NEWRELIC_LICENSE_KEY=`<YOUR_NEW_RELIC_LICENSE_KEY>`"
        EOF
        ```

#### (Optional) Forward NGINX logs [#forward-logs-otelcol]

Extend your collector configuration to include access and error logs if you want log events alongside metrics.

**Step 1: Configure NGINX Plus log format**

Before forwarding logs, configure NGINX Plus to use a structured log format. Refer to the [NGINX logging documentation](https://docs.nginx.com/nginx/admin-guide/monitoring/logging/) for guidance on configuring access and error logs.

**Step 2: Configure the OpenTelemetry Collector for log forwarding**

1.  Note the full paths to your NGINX access and error log files. Defaults are usually `/var/log/nginx/access.log` and `/var/log/nginx/error.log`.

2.  Update `/etc/otelcol-contrib/config.yaml` to add a `filelog` receiver and log pipeline:

    ```yaml
    receivers:
      prometheus:
        # existing Prometheus receiver configuration
      filelog/nginx_access_logs:
        include:
          - /var/log/nginx/access.log
      filelog/nginx_error_logs:
        include:
          - /var/log/nginx/error.log

    processors:
      batch:
        # existing settings
      filter/nginx_metrics:
        # existing settings
      resourcedetection:
        # existing settings
      resource/nginx:
        # existing settings
      transform/nginx_metrics:
        # existing settings
      transform/nginx_access_logs:
        log_statements:
          - context: resource
            statements:
              - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
              - set(attributes["logtype"], "nginx")
      transform/nginx_error_logs:
        log_statements:
          - context: resource
            statements:
              - set(attributes["nginx.display.name"], Concat(["server", attributes["nginx.deployment.name"]], ":"))
              - set(attributes["logtype"], "nginx-error")

    exporters:
      # existing exporter setup

    service:
      pipelines:
        # Your existing metrics pipeline...

        # Add log pipelines
        logs/nginx-access:
          receivers: [filelog/nginx_access_logs]
          processors: [batch, resource/nginx, transform/nginx_access_logs]
          exporters: [otlp_http]
        logs/nginx-error:
          receivers: [filelog/nginx_error_logs]
          processors: [batch, resource/nginx, transform/nginx_error_logs]
          exporters: [otlp_http]
    ```

3.  Grant the `otelcol-contrib` user read access to the log files:

    ```bash
    sudo usermod -a -G adm otelcol-contrib
    sudo chmod 644 /var/log/nginx/access.log
    sudo chmod 644 /var/log/nginx/error.log
    ```

4.  Restart the collector to apply the changes:

    ```bash
    sudo systemctl restart otelcol-contrib
    ```

#### Start monitoring [#start-monitoring-otelcol]

Now that everything is configured, start the OpenTelemetry Collector and verify that data is flowing to New Relic.

**Step 1: Start the collector**

1.  Apply the configuration changes:
    ```bash
    sudo systemctl daemon-reload
    sudo systemctl restart otelcol-contrib.service
    ```

2.  Verify the service is running:
    ```bash
    sudo systemctl status otelcol-contrib.service
    ```
    Expected output: `Active: active (running)` with no recent errors

**Step 2: Verify data collection**

3.  Check startup logs:
    ```bash
    sudo journalctl -u otelcol-contrib.service -n 20
    ```
4.  Generate test traffic (to create metrics):
    ```bash
    # Make a few requests to your NGINX Plus server
    curl http://localhost
    ```
5.  Allow time for initial data to appear in New Relic, then access your [NGINX dashboard](#find-data) to verify data collection.

## Find and use data [#find-data]

1.  Go to **[one.newrelic.com](https://one.newrelic.com) > Integrations & Agents**.
2.  Select **Dashboards**, and click **NGINX (OpenTelemetry Collector)** dashboard.
3.  In the popup window, select your account.
4.  Click View dashboard, and see your NGINX Plus data in New Relic.

The NGINX Plus metrics are attached to the `Metric` [event type](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/new-relic-data-types#events-new-relic). You can [query this data](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/query-new-relic-data) for troubleshooting purposes or to create custom charts and dashboards.

## Metrics collected [#metrics]

The OpenTelemetry Collector scrapes metrics from the [NGINX Prometheus exporter](https://github.com/nginx/nginx-prometheus-exporter), which exposes NGINX Plus HTTP API metrics in Prometheus format.

Below are the available NGINX Plus metrics:

**Connections**

| Metric                           | Description                 | Type  |
| -------------------------------- | --------------------------- | ----- |
| `nginxplus_connections_accepted` | Accepted client connections | Sum   |
| `nginxplus_connections_active`   | Active client connections   | Gauge |
| `nginxplus_connections_dropped`  | Dropped client connections  | Sum   |
| `nginxplus_connections_idle`     | Idle client connections     | Gauge |

**HTTP**

| Metric                            | Description           | Type  |
| --------------------------------- | --------------------- | ----- |
| `nginxplus_http_requests_total`   | Total http requests   | Sum   |
| `nginxplus_http_requests_current` | Current http requests | Gauge |

**SSL**

| Metric                            | Description                         | Type |
| --------------------------------- | ----------------------------------- | ---- |
| `nginxplus_ssl_handshakes`        | Successful SSL handshakes           | Sum  |
| `nginxplus_ssl_handshakes_failed` | Failed SSL handshakes               | Sum  |
| `nginxplus_ssl_session_reuses`    | Session reuses during SSL handshake | Sum  |

**HTTP Server Zones**

> #### ⚠️ IMPORTANT
>
> **Note:** These metrics are disabled by default. To enable them, see [(Optional) Enable additional metrics](#step2-enable-additional-metrics-nrdot) for NRDOT collector or [(Optional) Enable additional metrics](#step2-enable-additional-metrics-otelcol) for OpenTelemetry Collector Contrib.

| Metric                                   | Description                                        | Type  |
| ---------------------------------------- | -------------------------------------------------- | ----- |
| `nginxplus_server_zone_processing`       | Client requests that are currently being processed | Gauge |
| `nginxplus_server_zone_requests`         | Total client requests                              | Sum   |
| `nginxplus_server_zone_responses`        | Total responses sent to clients                    | Sum   |
| `nginxplus_server_zone_responses_codes`  | Total responses sent to clients by code            | Sum   |
| `nginxplus_server_zone_discarded`        | Requests completed without sending a response      | Sum   |
| `nginxplus_server_zone_received`         | Bytes received from clients                        | Sum   |
| `nginxplus_server_zone_sent`             | Bytes sent to clients                              | Sum   |
| `nginxplus_server_ssl_handshakes`        | Successful SSL handshakes                          | Sum   |
| `nginxplus_server_ssl_handshakes_failed` | Failed SSL handshakes                              | Sum   |
| `nginxplus_server_ssl_session_reuses`    | Session reuses during SSL handshake                | Sum   |

**Location Zones**

> #### ⚠️ IMPORTANT
>
> **Note:** These metrics are disabled by default. To enable them, see [(Optional) Enable additional metrics](#step2-enable-additional-metrics-nrdot) for NRDOT collector or [(Optional) Enable additional metrics](#step2-enable-additional-metrics-otelcol) for OpenTelemetry Collector Contrib.

| Metric                                    | Description                                   | Type |
| ----------------------------------------- | --------------------------------------------- | ---- |
| `nginxplus_location_zone_requests`        | Total client requests                         | Sum  |
| `nginxplus_location_zone_responses`       | Total responses sent to clients               | Sum  |
| `nginxplus_location_zone_responses_codes` | Total responses sent to clients by code       | Sum  |
| `nginxplus_location_zone_discarded`       | Requests completed without sending a response | Sum  |
| `nginxplus_location_zone_received`        | Bytes received from clients                   | Sum  |
| `nginxplus_location_zone_sent`            | Bytes sent to clients                         | Sum  |

**Cache**

> #### ⚠️ IMPORTANT
>
> **Note:** These metrics are disabled by default. To enable them, see [(Optional) Enable additional metrics](#step2-enable-additional-metrics-nrdot) for NRDOT collector or [(Optional) Enable additional metrics](#step2-enable-additional-metrics-otelcol) for OpenTelemetry Collector Contrib.

| Metric                                      | Description                                                             | Type  |
| ------------------------------------------- | ----------------------------------------------------------------------- | ----- |
| `nginxplus_cache_size`                      | Total size of the cache                                                 | Gauge |
| `nginxplus_cache_max_size`                  | Maximum size of the cache                                               | Gauge |
| `nginxplus_cache_cold`                      | Is the cache considered cold                                            | Gauge |
| `nginxplus_cache_hit_responses`             | Total number of cache hits                                              | Sum   |
| `nginxplus_cache_hit_bytes`                 | Total number of bytes returned from cache hits                          | Sum   |
| `nginxplus_cache_stale_responses`           | Total number of stale cache hits                                        | Sum   |
| `nginxplus_cache_stale_bytes`               | Total number of bytes returned from stale cache hits                    | Sum   |
| `nginxplus_cache_updating_responses`        | Total number of cache hits while cache is updating                      | Sum   |
| `nginxplus_cache_updating_bytes`            | Total number of bytes returned from cache while cache is updating       | Sum   |
| `nginxplus_cache_revalidated_responses`     | Total number of cache revalidations                                     | Sum   |
| `nginxplus_cache_revalidated_bytes`         | Total number of bytes returned from cache revalidations                 | Sum   |
| `nginxplus_cache_miss_responses`            | Total number of cache misses                                            | Sum   |
| `nginxplus_cache_miss_bytes`                | Total number of bytes returned from cache misses                        | Sum   |
| `nginxplus_cache_expired_responses`         | Total number of cache hits with expired TTL                             | Sum   |
| `nginxplus_cache_expired_bytes`             | Total number of bytes returned from cache hits with expired TTL         | Sum   |
| `nginxplus_cache_expired_responses_written` | Total number of cache hits with expired TTL written to cache            | Sum   |
| `nginxplus_cache_expired_bytes_written`     | Total number of bytes written to cache from cache hits with expired TTL | Sum   |
| `nginxplus_cache_bypass_responses`          | Total number of cache bypasses                                          | Sum   |
| `nginxplus_cache_bypass_bytes`              | Total number of bytes returned from cache bypasses                      | Sum   |
| `nginxplus_cache_bypass_responses_written`  | Total number of cache bypasses written to cache                         | Sum   |
| `nginxplus_cache_bypass_bytes_written`      | Total number of bytes written to cache from cache bypasses              | Sum   |

**Attributes**

| Attribute               | Description                                                                                                                                                                                                                                           | Example Values                                            |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `server_zone`           | The name of the server zone (applies to HTTP Server Zones metrics)                                                                                                                                                                                    | `example.com`, `api.example.com`                          |
| `code`                  | HTTP response status code (applies to response metrics)                                                                                                                                                                                               | `1xx`, `2xx`, `3xx`, `4xx`, `5xx`, `200`, `404`, `500`    |
| `location_zone`         | The name of the location zone                                                                                                                                                                                                                         | `/api`, `/images`, `/static`                              |
| `cache`                 | The name of the cache                                                                                                                                                                                                                                 | `my_cache`, `static_cache`                                |
| `nginx.server.endpoint` | The NGINX Plus API endpoint URL                                                                                                                                                                                                                       | `http://localhost:8080/api`                               |
| `nginx.deployment.name` | A unique name to identify this NGINX Plus 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 Plus 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) |

## Next steps [#next-steps]

**Learn more about your data:**

-   [Find and query your NGINX data](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/find-and-query-your-data/) - Access dashboards, create custom queries, and set up alerts
-   [Introduction to NRQL](https://docs.newrelic.com/docs/nrql/get-started/introduction-nrql-new-relics-query-language/) - Learn New Relic's query language for advanced data analysis
-   [Create NRQL alert conditions](https://docs.newrelic.com/docs/alerts/create-alert/create-alert-condition/create-nrql-alert-conditions/) - Set up custom alerts based on your NGINX Plus metrics

**Explore related monitoring:**

-   [Monitor self-hosted NGINX with OpenTelemetry](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/nginx-otel-host/) - For standard NGINX deployments
-   [Monitor NGINX on Kubernetes with OpenTelemetry](https://docs.newrelic.com/docs/opentelemetry/integrations/nginx/nginx-otel-kubernetes/) - For containerized environments
