nginx-ingress-controller
Security Monitoring is now available Security Monitoring is now available

nginx-ingress-controller

Agent Check Agent Check

Supported OS: Linux Mac OS Windows

Overview

This check monitors the kubernetes NGINX Ingress Controller.

Setup

Installation

The nginx-ingress-controller check is included in the Datadog Agent package, so you do not need to install anything else on your server.

Configuration

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 to start collecting your NGINX ingress controller metrics. See the sample nginx_ingress_controller.d/conf.yaml for all available configuration options. Then Restart the Agent.

For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.

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:

ParameterValue
<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 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:

  http-snippet: |
    server {
      listen 18080;

      location /nginx_status {
        allow all;
        stub_status on;
      }

      location / {
        return 404;
      }
    }

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.

ParameterValue
<LOG_CONFIG>[{"service": "controller", "source": "nginx-ingress-controller"}]

Validation

Run the Agent’s status subcommand and look for nginx_ingress_controller under the Checks section.

Data Collected

Metrics

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.requests.total
(count)
Total number of client requests
Shown as request
nginx_ingress.nginx.process.count
(gauge)
Number of nginx processes
Shown as process
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.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.controller.reload.success
(count)
Cumulative number of Ingress controller reload operations
nginx_ingress.controller.upstream.latency.count
(gauge)
Count of upstream service latency per Ingress
nginx_ingress.controller.upstream.latency.sum
(gauge)
Sum of upstream service latency per Ingress
Shown as second
nginx_ingress.controller.upstream.latency.quantile
(gauge)
Quantiles of upstream service latency per Ingress
Shown as second
nginx_ingress.controller.response.duration.count
(count)
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.requests
(count)
The total number of client requests
Shown as request
nginx_ingress.controller.cpu.time
(count)
Cpu usage in seconds
Shown as second
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.request.duration.count
(count)
The count of request processing time
nginx_ingress.controller.request.duration.sum
(gauge)
The sum of request processing time
Shown as millisecond

Events

The NGINX Ingress Controller does not include any events.

Service Checks

The NGINX Ingress Controller does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.