---
title: nginx-ingress-controller
description: Monitor metrics about the NGINX ingress controller and the embedded NGINX.
breadcrumbs: Docs > Integrations > nginx-ingress-controller
---

# nginx-ingress-controller
Supported OS Integration version5.4.0
## Overview{% #overview %}

This check monitors the Kubernetes [NGINX Ingress Controller](https://kubernetes.github.io/ingress-nginx). To monitor the F5 NGINX Ingress Controller, set up the [Datadog Prometheus integration](https://docs.datadoghq.com/agent/kubernetes/prometheus.md) to monitor desired metrics from the list provided by the [NGINX Prometheus Exporter](https://github.com/nginxinc/nginx-prometheus-exporter#exported-metrics).

## Setup{% #setup %}

### Installation{% #installation %}

The `nginx-ingress-controller` check is included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you do not need to install anything else on your server.

### Configuration{% #configuration %}

{% tab title="Host" %}
#### Host{% #host %}

If your Agent is running on a host, edit the `nginx_ingress_controller.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory. See the [sample nginx_ingress_controller.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/data/conf.yaml.example) for all available configuration options. Then, [restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands.md#start-stop-and-restart-the-agent).
{% /tab %}

{% tab title="Containerized" %}
#### Containerized{% #containerized %}

For containerized environments, see the [Autodiscovery Integration Templates](https://docs.datadoghq.com/agent/kubernetes/integrations.md) for guidance on applying the parameters below.
{% /tab %}

#### Metric collection{% #metric-collection %}

By default, NGINX metrics are collected by the `nginx-ingress-controller` check, but for convenience you might want to run the regular `nginx` check on the ingress controller.

You can achieve this by making the NGINX status page reachable from the Agent. To do this, use the `nginx-status-ipv4-whitelist` setting on the controller and add Autodiscovery annotations to the controller pod.

For example these annotations, enable both the `nginx` and `nginx-ingress-controller` checks and the log collection:

| Parameter            | Value                                                                                                              |
| -------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `<INTEGRATION_NAME>` | `["nginx","nginx_ingress_controller"]`                                                                             |
| `<INIT_CONFIG>`      | `[{},{}]`                                                                                                          |
| `<INSTANCE_CONFIG>`  | `[{"nginx_status_url": "http://%%host%%:18080/nginx_status"},{"prometheus_url": "http://%%host%%:10254/metrics"}]` |

See the [sample nginx_ingress_controller.d/conf.yaml](https://github.com/DataDog/integrations-core/blob/master/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/data/conf.yaml.example) for all available configuration options.

**Note**: For `nginx-ingress-controller` 0.23.0+ versions, the `nginx` server listening in port `18080` was removed, it can be restored by adding the following `http-snippet` to the configuration configmap:

```text
  http-snippet: |
    server {
      listen 18080;

      location /nginx_status {
        allow all;
        stub_status on;
      }

      location / {
        return 404;
      }
    }
```

**Note**: Histogram metrics (like `nginx_ingress.controller.response.*` metrics) are not collected by default and require the additional [collect_nginx_histograms](https://github.com/DataDog/integrations-core/blob/master/nginx_ingress_controller/datadog_checks/nginx_ingress_controller/data/conf.yaml.example#L59C7-L59C31) instance config parameter to be set to `true`. The parameter defaults to `false` because the histogram metrics are known to have high tag cardinality.

| Parameter           | Value                                                                                                                                                |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<INSTANCE_CONFIG>` | `[{"nginx_status_url": "http://%%host%%:18080/nginx_status"},{"prometheus_url": "http://%%host%%:10254/metrics", "collect_nginx_histograms": true}]` |

#### Log collection{% #log-collection %}

*Available for Agent versions >6.0*

Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes log collection](https://docs.datadoghq.com/agent/kubernetes/log.md).

| Parameter      | Value                                                               |
| -------------- | ------------------------------------------------------------------- |
| `<LOG_CONFIG>` | `[{"service": "controller", "source": "nginx-ingress-controller"}]` |

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands.md#agent-status-and-information) and look for `nginx_ingress_controller` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **nginx\_ingress.controller.cpu.time**(count)                  | Cpu usage in seconds*Shown as second*                                           |
| **nginx\_ingress.controller.last.reload.success**(gauge)       | Whether the last configuration reload attempt was successful                    |
| **nginx\_ingress.controller.mem.resident**(gauge)              | Resident memory size in bytes*Shown as byte*                                    |
| **nginx\_ingress.controller.mem.virtual**(gauge)               | Virtual memory size in bytes*Shown as byte*                                     |
| **nginx\_ingress.controller.reload.success**(count)            | Cumulative number of Ingress controller reload operations                       |
| **nginx\_ingress.controller.request.duration.count**(gauge)    | The count of request processing time                                            |
| **nginx\_ingress.controller.request.duration.sum**(gauge)      | The sum of request processing time*Shown as millisecond*                        |
| **nginx\_ingress.controller.request.size.count**(gauge)        | The count of request size                                                       |
| **nginx\_ingress.controller.request.size.sum**(gauge)          | The sum of request size*Shown as byte*                                          |
| **nginx\_ingress.controller.requests**(count)                  | The total number of client requests*Shown as request*                           |
| **nginx\_ingress.controller.response.duration.count**(gauge)   | Count of response duration per Ingress                                          |
| **nginx\_ingress.controller.response.duration.sum**(gauge)     | Sum of response duration per Ingress*Shown as second*                           |
| **nginx\_ingress.controller.response.size.count**(gauge)       | Count of response size per Ingress                                              |
| **nginx\_ingress.controller.response.size.sum**(gauge)         | Sum of response size per Ingress*Shown as byte*                                 |
| **nginx\_ingress.controller.upstream.latency.count**(gauge)    | [Deprecated] Count of upstream service latency per Ingress                      |
| **nginx\_ingress.controller.upstream.latency.quantile**(gauge) | [Deprecated] Quantiles of upstream service latency per Ingress*Shown as second* |
| **nginx\_ingress.controller.upstream.latency.sum**(gauge)      | [Deprecated] Sum of upstream service latency per Ingress*Shown as second*       |
| **nginx\_ingress.nginx.bytes.read**(count)                     | Number of bytes read*Shown as byte*                                             |
| **nginx\_ingress.nginx.bytes.write**(count)                    | Number of bytes written*Shown as byte*                                          |
| **nginx\_ingress.nginx.connections.current**(gauge)            | Current number of client connections with state*Shown as connection*            |
| **nginx\_ingress.nginx.connections.total**(count)              | Total number of connections with state*Shown as connection*                     |
| **nginx\_ingress.nginx.cpu.time**(count)                       | Cpu usage in seconds*Shown as second*                                           |
| **nginx\_ingress.nginx.mem.resident**(gauge)                   | Resident memory size in bytes*Shown as byte*                                    |
| **nginx\_ingress.nginx.mem.virtual**(gauge)                    | Virtual memory size in bytes*Shown as byte*                                     |
| **nginx\_ingress.nginx.process.count**(gauge)                  | Number of nginx processes*Shown as process*                                     |
| **nginx\_ingress.nginx.requests.total**(count)                 | Total number of client requests*Shown as request*                               |

### Events{% #events %}

The NGINX Ingress Controller does not include any events.

### Service Checks{% #service-checks %}

The NGINX Ingress Controller does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
