Apache is a widely-used web server for a variety of operating systems. For more information, visit http://httpd.apache.org/.
Even if the Apache plugin is not configured, Stackdriver Monitoring discovers Apache services running in your Cloud Platform project by:
Searching instance names for apache
Checking for ports opened to 80 or 443 via firewall rules
The discovered services are displayed on the Apache Services page in the Resources menu. After you install the monitoring agent and configure the Apache plugin on your instances, Monitoring populates the Apache Services page with inventory and metrics.
Configuring Monitoring to monitor Apache
After you install the monitoring agent, use the following instructions to configure the Apache plugin on your instances.
The Apache plugin requires the
mod_status plugin to be enabled in Apache. Many
Apache installations enable this plugin by default. To see if the plugin is
enabled on your VM instance, run the following request:
If the plugin is enabled, then the output includes lines similar to the following:
Total Accesses: 2 Total kBytes: 1 BusyWorkers: 1 IdleWorkers: 4
If instead you get a
404 Not Found page, then
mod_status is not enabled.
Here are several options to enable the
Download status.conf and place it in the Apache configuration directory on your VM instance, typically in
(cd /etc/httpd/conf.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf)
Append the contents of status.conf to your main Apache configuration file, normally located at either
/etc/apache2/apache2.confon your VM instance.
Reload the Apache configuration by running:
For Debian and Ubuntu:
sudo service apache2 reload
Other Linux distributions:
sudo service httpd reload
Enabling the Apache monitoring plugin
To enable the Apache monitoring plugin, complete the following steps:
On your VM instance, download apache.conf and place it in the directory
(cd /opt/stackdriver/collectd/etc/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/apache.conf)
If you're not using the default or Stackdriver-provided Apache
mod_statusconfiguration, as root, edit
apache.confby following the instructions at the top of the file.
Restart the monitoring agent:
sudo service stackdriver-agent restart
For more information on the
apache plugin, see
What is monitored
The full list of metrics the Apache plugin monitors is at Agent metrics: apache.