Apache integration

New Relic Infrastructure's on-host integrations include an Apache integration that instruments your Apache web server. This document explains how to install and configure the Apache integration, and describes the data collected.

This integration is released as open source under the MIT license on GitHub. A change log is also available there for the latest updates.


Access to this feature depends on your subscription level. Requires Infrastructure Pro.

New Relic's Apache integration sends performance metrics and inventory data from your Apache web server to New Relic products, including Infrastructure and Insights. You can view pre-built dashboards of your Apache metric data, create alert policies, and create your own custom queries and charts in Insights.

The integration works by gathering data from Apache's status module, so that module must be enabled and configured for your Apache instance (more details in Requirements).

Compatibility and requirements

To use the Apache integration, ensure your system meets these requirements:

Install and activate

On-host integrations do not automatically update. For best results, you should occasionally update the integration package and update the Infrastructure agent.

To install the Apache integration:

  1. Follow the instructions for installing an integration, using the file name nri-apache.
  2. Via the command line, change directory to the integration's folder:

    cd /etc/newrelic-infra/integrations.d
  3. Create a copy of the sample configuration file by running:

    sudo cp apache-config.yml.sample apache-config.yml
  4. Edit the configuration file apache-config.yml using the configuration settings described below.

  5. Restart the Infrastructure agent.

It is also possible to manually install integrations from a tarball file. For more information, see Install manually from a tarball archive.


The Apache integration's config file gives you control over how data is collected. Here are some values you may want to change:

  • metrics: This command captures the metrics of a particular Apache server. This takes a single argument:
    • status_url: The URL set up to provide the metrics using the Apache status info module. Default value: If you have customized your setup to use a different endpoint, you will need to set this value.
  • inventory: This command captures the modules loaded by Apache as inventory data, using Apache's binary file. To disable the collection of inventory data, delete the inventory command from the config file.
  • labels: The env label controls the environment attribute in Insights. The default value is production.

For general information about the config file structure, see the SDK documentation.

Activating remote monitoring

For version 1.2.0 or higher, a new configuration parameter called remote_monitoring enables remote monitoring and multi-tenancy for this integration.

Activating remote_monitoring may change some attributes and/or affect your configured alerts. For more information, see remote monitoring in on-host integrations.

*Infrastructure agent version 1.2.25 or higher is required to use remote_monitoring.

Environment variable passthroughs

Environment variables can be used to control config settings, and are then passed through to the Infrastructure agent. For instructions on how to use this feature, see Configure the Infrastructure agent.


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

Type String



Alternative file to use for custom SSL certificate.

Type String
Default (none)



Alternative path to use to find SSL certificate bundle file.

Type String
Default (none)



Find and use data

To find your integration data in Infrastructure, go to infrastructure.newrelic.com > Third-party services and select one of the Apache integration links.

In New Relic Insights, Apache data is attached to the ApacheSample event type.

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

Metric data

The Apache integration collects the following metric data attributes. Each metric name is prefixed with a category indicator and a period, such as net. or server..

Name Description
net.bytesPerSecond Rate of the number of bytes served, in bytes per second.
net.requestsPerSecond Rate of the number of client requests, in requests per second.
server.busyWorkers Current number of busy workers.
server.idleWorkers Current number of idle workers.
server.scoreboard.closingWorkers Current number of workers closing TCP connection after serving the response.
server.scoreboard.dnsLookupWorkers Current number of workers performing a DNS lookup.
server.scoreboard.finishingWorkers Current number of workers gracefully finishing.
server.scoreboard.idleCleanupWorkers Current number of idle workers ready for cleanup.
server.scoreboard.keepAliveWorkers Current number of workers maintaining a keep-alive connection.
server.scoreboard.loggingWorkers Current number of workers that are logging.
server.scoreboard.readingWorkers Current number of workers reading requests (headers or body).
server.scoreboard.startingWorkers Current number of workers that are starting up.
server.scoreboard.totalWorkers Total number of workers available. Workers that are not needed to process requests may not be started.
server.scoreboard.writingWorkers Current number of workers that are writing.

Inventory data

Inventory data captures the version numbers from running Apache and from all loaded Apache modules, and adds those version numbers under the config/apache namespace. For more about inventory data, see Understand integration data.

System metadata

Besides the standard attributes collected by the Infrastructure agent, the integration collects inventory data associated with the ApacheSample Insights event type:

Name Description
software.version The version of the Apache server. Example: Apache/2.4.7 (Ubuntu).


Problem accessing HTTPS endpoint for Apache

If you are having issues accessing the HTTPS endpoint for Apache, here are two possible solutions:

  • Although you cannot ignore the SSL certification, you can set the config file parameters ca_bundle_file and ca_bundle_dir to point to an unsigned certificate in the Apache config file. Example:

    	- name: apache-server-metrics
    command: metrics
    	ca_bundle_file: /etc/newrelic-infra/integrations.d/ssl/b2b.ca-bundle

    An example using ca_bundle_dir:

    ca_bundle_dir: /etc/newrelic-infra/integrations.d/ssl
  • Alternatively, you can use HTTP instead of HTTPS.

For more help

Recommendations for learning more: