NGINX and NGINX Plus - Monitoring Extension

This extension works only with the standalone machine agent.

 

Use Case

NGINX (open source) and NGINX Plus (commercial) is an HTTP server and reverse proxy, and an IMAP/POP3 proxy server. The NGINX and NGINX Plus monitoring extension gets metrics from the NGINX server and displays them in the AppDynamics Metric Browser. This extension supports both the open source NGINX and its commercial variant NGINX Plus.

Metrics include:

  • Active connections
  • Total number of requests
  • Accepted and handled requests
  • Reading, writing, and waiting

Installation

Note: For the following steps to work, NGINX should be running with "ngx_http_stub_status_module" or "ngx_http_status_module" enabled. Please make sure you have required changes in the nginx.conf.

  1. Download and Unzip the file NginxMonitor.zip into <machineagent install dir>/monitors/
  2. Open monitor.xml and configure the arguments
  3. Restart the machineagent
  4. In the AppDynamics Metric Browser, look for: Application Infrastructure Performance | <Tier> | Custom Metrics | WebServer | NGinX.

Directory Structure

Directory/FileDescription
src/main/resources/confContains the monitor.xml
src/main/javaContains source code of the NGINX/NGINX Plus monitoring extension
targetOnly obtained when using maven. Run 'mvn clean install' to get the distributable .zip file
pom.xmlMaven build script to package the project (required only if changing Java code)

 

Metrics

 

NGINX Metrics

Metric NameDescription
Active ConnectionsNumber of all open active connections
Server: AcceptsNumber of accepted requests
Server: HandledNumber of handled requests
Server: RequestsTotal number of requests
ReadingNginx reads request header
WritingNginx reads request body, processes request, or writes response to a client
WaitingNGinX keep-alive connections or currently active

 

NGINX Plus Metrics

 

Requests

Metric NameDescription
totalThe total number of client requests
currentThe current number of client requests

 

Server Zones

Metric NameDescription
processingThe number of client requests that are currently being processed
requestsThe total number of client requests received from clients
responses/totalThe total number of responses sent to clients
responses/ 1xx, 2xx, 3xx, 4xx, 5xxThe number of responses with status codes 1xx, 2xx, 3xx, 4xx, and 5xx
receivedThe total number of bytes received from clients
sentThe total number of bytes sent to clients

 

Upstreams

Metric NameDescription
activeThe current number of active connections
backupA boolean value indicating whether the server is a backup server
downstartThe time (in milliseconds since Epoch) when the server became “unavail” or “unhealthy”
downtimeTotal time the server was in the “unavail” and “unhealthy” states
failsThe total number of unsuccessful attempts to communicate with the server
keepaliveThe current number of idle keepalive connections
receivedThe total number of bytes received from this server
requestsThe total number of client requests forwarded to this server
sentThe total number of bytes sent to this server
stateurrent state, which may be one of “up”, “down”, “unavail”, or “unhealthy”.
unavailTimes the server became unavailable
weightWeight of the server
responses/totalThe total number of responses obtained from this server
responses/ 1xx, 2xx, 3xx, 4xx, 5xxThe number of responses with status codes 1xx, 2xx, 3xx, 4xx, and 5xx
health_checks/checksThe total number of health check requests made
health_checks/failsThe number of failed health checks
health_checks/unhealthyHow many times the server became unhealthy (state “unhealthy”)
health_checks/last_passedBoolean indicating if the last health check request was successful and passed tests

 

Connections

Metric NameDescription
acceptedThe total number of accepted client connections
droppedThe total number of dropped client connections
activeThe current number of active client connections
idleThe current number of idle client connections

 

Caches

Metric NameDescription
sizeThe current size of the cache
max_sizeThe limit on the maximum size of the cache specified in the configuration
coldA boolean value indicating whether the “cache loader” process is still loading data from disk into the cache
hit, stale, updating, revalidated/responsesThe total number of responses read from the cache
hit, stale, updating, revalidated/bytesThe total number of bytes read from the cache
miss, expired, bypass/responsesThe total number of responses not taken from the cache
miss, expired, bypass/bytesThe total number of bytes read from the proxied server
miss, expired, bypass/responses_writtenThe total number of responses written to the cache
miss, expired, bypass/bytes_writtenThe total number of bytes written to the cache

 

Custom Dashboard

 

Contributing

 

Always feel free to fork and contribute any changes directly via GitHub.

 

Support

 

For any questions or feature request, please contact AppDynamics Center of Excellence.

 

Version:

1.1.4

Compatibility:

4.1+

NGinx Version:

1.6.2, 1.9.9

Last Update:

13 Oct 2016

 

1.0.2 - Fixing code to show all metrics

1.1.0 - Added support for NGinx Plus

1.1.1 - Fixed an issue with connection leak

1.1.2 - Added support for NGinx data set version 6

1.1.3 - Added support for Content-Type with charset

1.1.4 - Added support for multiple servers

1.1.5 - Removed username and password from config.yml

1.1.6 - Fixed errors with SSL and HTTP client

1.1.7 - Fixed customer issue with multiple servers