Our NGINX integration collects and sends inventory 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.
Read on to install the integration, and to see what data we collect.
Compatibility and requirements
Our integration is compatible with both NGINX Open Source and NGINX Plus.
Before installing the integration, make sure that you meet the following requirements:
- NGINX extension enabled, as described in the Configure the integration section.
- If NGINX is not running on Kubernetes or Amazon ECS, you must install the infrastructure agent on a Linux OS host that's running NGINX. Otherwise:
- If running on Kubernetes, see these requirements.
- If running on ECS, see these requirements.
Install and activate the integration
To install the NGINX integration, follow the instructions for your environment:
- ECS
- Kubernetes
- Linux
-
-
Follow the general instructions for installing an integration, using the filename
nri-nginx
. Then continue on to the steps below. -
Change the directory to the integrations configuration folder:
cd /etc/newrelic-infra/integrations.d
-
Copy the sample configuration file:
sudo cp nginx-config.yml.sample nginx-config.yml
-
Edit the configuration file
nginx-config.yml
. - Restart the infrastructure agent.
-
Additional notes:
- Advanced: Integrations are also available in tarball format to allow for install outside of a package manager.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
Configure the integration
An integration's YAML-format configuration is where you can place required login credentials and configure how data is collected. Which options you change depend on your setup and preference.
To capture data from the NGINX integration, you must first enable and configure the applicable extension module:
- For NGINX Open Source: HTTP stub status module
- For NGINX Plus: HTTP status module and HTTP API module
There are several ways to configure the integration, depending on how it was installed:
- If enabled via Kubernetes: see Monitor services running on Kubernetes.
- If enabled via Amazon ECS: see Monitor services running on ECS.
- If installed on-host: edit the config in the integration's YAML config file,
nginx-config.yml
.
Config options include:
-
metrics
: This command captures the metrics of a particular NGINX server. Arguments:-
status_url
: The URL set up to provide the metrics using the status module. If the default value of127.0.0.1
is incorrect, substitute the address/FQDN/URL for your system. Example:status_url: http://127.0.0.1/status
-
inventory
: This command captures the configuration parameters set in the NGINX config file as inventory data. Arguments:-
config_path
: The path to the NGINX configuration file. -
status_url
: The URL is used to attach inventory data to the same NGINX instance for which we collect metrics.
To disable inventory data collection, remove the inventory command.
When running in a container, to retrieve inventory data you need to map the local config_path into the container, otherwise the integration terminates. See instructions for Docker on how to map volumes to share files between the host and the container.
For Kubernetes, ECS, and potentially other environments where you can have more than one instance running,
inventory
is complex to configure. We strongly suggest disablinginventory
in this case.-
labels
: Theenv
label controls theenvironment
attribute. The default value isproduction
.
Activate remote monitoring
You can use the remote_monitoring
configuration parameter to enable remote monitoring and multi-tenancy for this integration. You must also have infrastructure agent version 1.2.25 or higher to use remote_monitoring
.
Activating remote_monitoring
may change some attributes and/or affect your configured alerts. For more information, see remote monitoring in on-host integrations.
Environment variable passthroughs
Environment variables can be used to control config settings, such as your license key, and are then passed through to the Infrastructure agent. For instructions on how to use this feature, see Configure the Infrastructure agent.
With secrets management, you can configure on-host integrations with New Relic Infrastructure's agent to use sensitive data (such as passwords) without having to write them as plain text into the integration's configuration file. For more information, see Secrets management.
- STATUS_URL
-
The URL set up to provide the metrics using the status module.
Type String Default http://127.0.0.1/status
Example:
STATUS_URL='http://your.ip.address:8080/status'
- CONFIG_PATH
-
The path to the NGINX configuration file.
Type String Default /etc/nginx/nginx.conf Example:
CONFIG_PATH='/etc/nginx/custom/mynginx.conf'
For more about the general structure of on-host integration configuration, see Configuration.
Find and use data
Data from this service is reported to an integration dashboard.
Metrics are attached to the NginxSample
event type. You can query this data for troubleshooting purposes or to create custom charts and dashboards.
For more on how to find and use your data, see Understand integration data.
Metrics
The NGINX integration collects the following metric data attributes. To find these attributes, query the NginxSample
event type.
NGINX Open Source
Metric | Description |
---|---|
net.connectionsActive |
Number of connections that are currently active |
net.connectionsAcceptedPerSecond |
Number of accepted client connections per second |
net.connectionsDroppedPerSecond |
Number of connections per second that were accepted but could not he handled and hence dropped |
net.connectionsReading |
Current number of connections where NGINX is reading the request header |
net.connectionsWaiting |
Current number of idle client connections waiting for a request |
net.connectionsWriting |
Current number of connections where NGINX is writing the response back to the client |
net.requestsPerSecond |
Total number of client requests per second |
NGINX Plus
Our integration retrieves all available metric data from the following HTTP API endpoints: /nginx
, /processes
, /connections
, /http/requests
, and /ssl
.
Metric | Description |
---|---|
net.connectionsAcceptedPerSecond |
Accepted client connections as requests per second |
net.connectionsDroppedPerSecond |
Dropped client connections as requests per second |
net.connectionsActive |
Current number of active client connections |
net.connectionsIdle |
Current number of idle client connections |
net.requests |
Current number of requests |
net.requestsPerSecond |
Current number of requests per second |
processes.respawned |
Current number of abnormally terminated and respawned child processes |
ssl.handshakes |
Current number for successful SSL handshakes |
ssl.failedHandshakes |
Current number of failed SSL handshakes |
ssl.sessionReuses |
Current number of session reuses during SSL handshake |
Inventory data
The integration captures configuration options defined in the NGINX master config file (usually nginx.conf
).
The master NGINX config file can contain "include OTHER_FILE_NAME"
commands for splitting the configuration into multiple files. The Infrastructure agent ignores (does not parse) configuration set via include
commands.
System metadata
The integration collects these additional attributes about the NGINX service:
Name | Description |
---|---|
software.edition |
The NGINX edition: either |
software.version |
The version of NGINX. |
Check the source code
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.