Product Documentation

NGINX

Type of Data

Load Balancer Metrics

Description

NGINX monitoring is a time-based report, based the available data metrics. It provides visibility to customers for metrics that are available in their Openmix applications. The time-based reporting of the NGINX metrics is ingested by Fusion so that customers can see the current and recent performance of the load balancers.

It provides data on NGNIX load balancer and application server health. It displays the metrics of the NGINX Fusion feed in a way that provides feedback to the customer on the health of the NGINX servers. The standard NGINX Fusion integration allows NGINX metrics to be included in Openmix applications.

Data Feed Format

Sample data feed

    {
        "accepts": "5015",
         "active": "4",
         "handled": "5015",
         "reading": "0",
         "requests": "5482",
         "waiting": "3",
         "writing": "1"
    }

Feed values

Metric Feed Value
Accepted Connections accepts
Current Connections active
Handled Connections handled
Connections Reading reading
Total Requests requests
Connections Idle waiting
Connections Writing writing
  Values that can be calculated in the app:
Dropped Connections accepts - handled
Current Requests reading + writing

Configured Info per Load Balancer

Endpoint from where to pull status: http://nginx.org/en/docs/http/ngx_http_stub_status_module.html

Server Configuration

Example Configuration

http://nginx.org/en/docs/http/ngx_http_stub_status_module.html

Metrics collection: NGINX (open-source)

Open source NGINX exposes several basic metrics about server activity on a simple status page, provided that you have the HTTP stub status module enabled.

To check if the module is already enabled, run:nginx -V 2>&1 grep -o with-http_stub_status_module

The status module is enabled if you see with-http_stub_status_moduleas output in the terminal. If that command returns no output, you will need to enable the status module. You can use the --with-http_stub_status_module configuration parameter when building NGINX from source:

  ./configure \
  … \
  --with-http_stub_status_module
  make
  sudo make install

After verifying the module is enabled or enabling it yourself, you will also need to modify your NGINX configuration to set up a locally accessible URL (e.g., /nginx_status) for the status page:

  server {
    location /nginx_status
    {
      stub_status on;
      access_log off;
      allow 127.0.0.1;
      deny all;
    }
  }

Note: The server blocks of the NGINX config are usually found not in the master configuration file (e.g., /etc/nginx/nginx.conf) but in supplemental configuration files that are referenced by the master config. To find the relevant configuration files, first locate the master config by running:

  nginx -t

Open the master configuration file listed, and look for lines beginning with include near the end of the http block, such as:

  include/etc/nginx/conf.d/*.conf

In one of the referenced config files you should find the main server block, which you can modify as above to configure NGINX metrics reporting. After changing any configurations, reload the configs by executing:

  nginx -s reload

Now you can view the status page to see your metrics:

  Active connections: 24
  server accepts handled requests
  1156958 1156958 4491319
  Reading: 0 Writing: 18 Waiting : 6

Note that if you are trying to access the status page from a remote machine, you will need to whitelist the remote machine’s IP address in your status configuration, just as 127.0.0.1 is white-listed in the configuration snippet above.

The NGINX status page is an easy way to get a quick snapshot of your metrics, but for continuous monitoring you will need to automatically record that data at regular intervals. Parsers for the NGINX status page already exist for monitoring tools such as Nagios and Datadog, as well as for the statistics collection daemon collectD.

Source: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/

Setup in Fusion

You can access Fusion Data Feeds from the left navigation pane, under Openmix. For initial steps please refer to the Fusion Integration Documentation.

When you get to the service-specific configuration dialog box, enter the following:

  • Name: The name given to the data feed. This will default to “Service - Platform Name” if not specified.
  • Run Every: The frequency with which the data feed is updated from the service.
  • Platform: The Platform that is associated with the data feed.
  • URL: The URL is an endpoint on the customer’s network that returns the data that the customer wants to see in Openmix.

Once the installation is complete, it will be listed on the Fusion data feeds home page with a green status and monitoring metrics in the log history.

To edit a Fusion data feed click on the data feed in the list and then click the Edit button. Once you have changed the configuration, click Save. This will bring you back to the data feed list with your changes saved and applied to the data feed.

NGINX