Nginx monitoring integration

Our NGINX integration collects and sends inventory, logs, and metrics from your NGINX server to our platform, where you can see data on connections and client requests so that you can find the source of any problems.

Image of the dashboard available through the NGINX quickstart

Dashboard installed through the New Relic NGINX Monitor quickstart.

To get the most out of this page, select the installation method that fits your environment. You need a New Relic account to finish the installation process.

Choose your framework

Choose your install path

Check the compatibility and requirements

Our integration is compatible with both NGINX Open Source and NGINX Plus.

Download the infrastructure agent

To use the NGINX integration, you need to first install the infrastructure agent on the same host. The infrastructure agent monitors the host itself, while the integration you'll install in the next step extends your monitoring with NGINX-specific data, such as connections and request metrics.

Download using APT

  1. Run the following commands:

    bash
    $
    sudo apt-get update
    bash
    $
    sudo apt-get install nri-nginx

Configure the NGINX integration

  1. Change directory to the integrations configuration folder by running:

    bash
    $
    cd /etc/newrelic-infra/integrations.d
  2. Copy the sample configuration file by running:

    bash
    $
    sudo cp nginx-config.yml.sample nginx-config.yml
  3. Edit the nginx-config.yml file. This example config file collects basic metrics like Metrics and Inventory:

    integrations:
    - name: nri-nginx
    env:
    METRICS: "true"
    STATUS_URL: http://127.0.0.1/status
    STATUS_MODULE: discover
    REMOTE_MONITORING: true
    interval: 30s
    labels:
    env: production
    role: load_balancer
    - name: nri-nginx
    env:
    INVENTORY: "true"
    STATUS_URL: http://127.0.0.1/status
    CONFIG_PATH: /etc/nginx/nginx.conf
    REMOTE_MONITORING: true
    interval: 60s
    labels:
    env: production
    role: load_balancer
    inventory_source: config/nginx

Specific settings related to NGINX are defined using the env: section of the configuration file. These settings control the connection to your NGINX instance as well as other security settings and features. The list of valid settings is described in the next section of this document.

You can find all the config options at the bottom of this doc along with more complex config examples.

Find and use data

  1. Go to one.newrelic.com > Integrations & Agents and type NGINX.
  2. Select Dashboards, and click NGINX overview dashboard.
  3. In the popup window, select your account
  4. Click View dashboard, and see your NGINX data in New Relic.

Metrics that are attached to the NginxSample event type. You can query this data for troubleshooting purposes or to create custom charts and dashboards.

You can find a full list of metrics and their attributes at the bottom of this doc.

For more on how to find and use your data, see how to understand integration data.

NGINX config settings

The following configuration options are available:

Setting

Description

Default

Applies to

STATUS_URL

The URL set up to provide the metrics using the status module.

http://127.0.0.1/status

Metrics/Inventory

STATUS_MODULE

Name of NGINX status module.
Valid options are:

  • discover
  • ngx_http_stub_status_module
  • ngx_http_status_module
  • ngx_http_api_module

discover

Metrics

CONNECTION_TIMEOUT

Connection timeout to the NGINX instance in seconds.

5

Metrics

VALIDATE_CERTS

Set to false if the status URL is HTTPS with a self-signed certificate.

true

Metrics

CONFIG_PATH

The path to the NGINX configuration file.

N/A

Inventory

REMOTE_MONITORING

Enable multi-tenancy monitoring.

Read more about remote monitoring.

true

Metrics/Inventory

METRICS

Set to true to enable Metrics only collection.

false

INVENTORY

Set to true to enable Inventory only collection.

false

Metric data

The NGINX integration collects the following metrics: