Apache

Overview

This plugin collects metrics from the mod_status module, targeting the server-status endpoint. The plugin requests the machine-readable content from this endpoint and parses metrics out from the retrieved data.

Note

This plugin is currently only available for x86_64 Linux.

Setup

The apache plugin is included with the AppOptics host agent by default, please follow the directions below to enable it for a host agent instance.

Prerequisites

This plugin requires that mod_status with the ExtendedStatus option is enabled for your Apache server. Below is an example configuration:

<Location /server-status>
      SetHandler server-status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1 ::1
      Allow from your.ip.address.here
</Location>
ExtendedStatus on

Please refer to the Apache mod_status documentation for more information.

Configuration

The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your Apache server. To enable the plugin:

  1. Make a copy of the apache example configuration file /opt/appoptics/etc/plugins.d/apache.yaml.example, renaming it to /opt/appoptics/etc/plugins.d/apache.yaml:
$ sudo cp /opt/appoptics/etc/plugins.d/apache.yaml.example /opt/appoptics/etc/plugins.d/apache.yaml
  1. Update /opt/appoptics/etc/plugins.d/apache.yaml configuration file with settings specific to your Apache server, for example:
collector:
  apache:
    all:
      apache_mod_status_url: "http://localhost/server-status?auto"
      safe: false

load:
  plugin: snap-plugin-collector-aoapache
  task: task-aoapache.yaml

The key apache_mod_status_url is a required setting and defaults to an empty string, it should be set to the mod_status URL to query.

The key safe is an optional setting that defaults to true, which limits the plugin to only report metrics that don’t give away key details about the implementation of the mod_status endpoint or Apache itself. The metrics listing below notes which ones would be collected based on this setting.

  1. Restart the host agent:
$ sudo service appoptics-snapteld restart
  1. Enable the Apache plugin in the AppOptics UI

On the Integrations Page you will see the Apache plugin available if the previous steps were successful. If you do not see the plugin, see Troubleshooting.

Select the Apache plugin to open the configuration menu in the UI, and enable the plugin.

You should soon see the apache metrics reported to your dashboard.

Metrics and Tags

The table below lists each of the metrics gathered from the status endpoint.

Default Metrics

Tag Namespace Description Safe
apache.BusyWorkers Busy workers Y
apache.BytesPerSec Bytes transferred per second Y
apache.ConnsAsyncClosing Asynchronous closing conns Y
apache.ConnsAsyncKeepAlive Asynchronous keepalive conns Y
apache.ConnsAsyncWriting Asynchronous writing conns Y
apache.ConnsTotal Total connections Y
apache.CPULoad CPU load Y
apache.CPUSystem jiffs used in System Mode N
apache.IdleWorkers Idle workers Y
apache.ReqPerSec Requests per second Y
apache.Uptime Server uptime Y
apache.workers.Closing Closing connection Y
apache.workers.DNSLookup DNS Lookup Y
apache.workers.Finishing Gracefully finishing Y
apache.workers.Idle_Cleanup Idle cleanup of worker Y
apache.workers.Keepalive Keepalive (read) Y
apache.workers.Logging Logging Y
apache.workers.Open Open slot with no current process Y
apache.workers.Reading Reading Request Y
apache.workers.Sending Sending Reply Y
apache.workers.Starting Starting up Y
apache.workers.Waiting Waiting for Connection Y
apache.Load1 Server load over last 1 minute N
apache.Load5 Server load over last 5 minutes N
apache.Load15 Server load over last 15 minutes N

Default Metric Tags

All Apache metrics are tagged with hostname. Instead of using that tag we recommend using the @host alias.

Optional Metrics

Optinal metrics can be activated by editing the task yaml. For more information please read the Host Agent configuration article.

Tag Namespace Description Safe
apache.BytesPerReq Bytes transferred per request N
apache.Total_Accesses Total accesses Y
apache.Total_kBytes Total kBytes Y
apache.ServerVersion Apache server version N
apache.ServerMPM Apache servers selected MPM N
apache.Server_Built Build time for server N
apache.CurrentTime Current server time N
apache.RestartTime Last server restart time N
apache.ParentServerConfigGeneration # times apache has reread configs and restarted child processes N
apache.ParentServerMPMGeneration # times apache has reread MPM configs and restarted child processes N
apache.ServerUptime Server uptime in readable string N
apache.CPUUser jiffs used in User Mode N
apache.CPUChildrenUser jiffs used in User Mode by child processes N
apache.CPUChildrenSystem jiffs used in System Mode by child processes N