Skip Navigation

03 Jul 2022

Monitoring Nginx with Amplify

Sahil Kokamkar
Nginx Amplify

NGINX Amplify is a free, SaaS based monitoring tool for NGINX Open Source and NGINX Plus. It uses Amplify agent to collect metrics from logs.

With NGINX Amplify you can monitor performance of the underlying OS, application servers, databases etc.

Installing Nginx Amplify Agent

It's easy to install Nginx Amplify, you can follow their docs or use the below one-liner. Just make sure you created Nginx amplify account.

wget https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh && chmod +x install.sh && API_KEY='YOUR_API_KEY' sh ./install.sh

Once you are done, you should be able to see your Nginx instance in the dashboard.

Here is how dashboard looks like:

Nginx Amplify Dashboard

Graphs:

Graphs

By default, request time isn't logged. To configure it, change the logging format to the following;

log_format  rt  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" '
                      '"$host" sn="$server_name" '
                      'rt=$request_time '
                      'ua="$upstream_addr" us="$upstream_status" '
                      'ut="$upstream_response_time" ul="$upstream_response_length" '
                      'cs=$upstream_cache_status' ;

And add it

access_log  /var/log/nginx/access.log  rt;

Configuring Alert

You can create custom alert for metrics for specific metrics.

Custom Alert

There is more stuff you can do such as custom dashboard to add additional instances.