Apache is a widely-used web server for a variety of operating systems. For more information, visit http://httpd.apache.org/.
This functionality is only available for agents running on Linux. It is not available on Windows.
Even if the Apache plugin is not configured, Cloud 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
To see the metrics for Apache, go to Monitoring:
Select Dashboards and then select the Apache HTTP Server dashboard from the list.
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 that you enable the
mod_status plugin 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
/etc/apache2/conf.d. For more information about enabling the
mod_statusplugin, refer to the Apache 2.4 or Apache 2.2 documentation:
(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, Ubuntu, and SLES:
sudo a2enmod mod_status sudo a2enmod mod_access_compat 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 /etc/stackdriver/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 Google Cloud's operations suite-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.