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.
Discovery
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, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- 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.
Prerequisite
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:
curl http://local-stackdriver-agent.stackdriver.com:80/server-status?auto
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 mod_status
plugin:
Download status.conf and place it in the Apache configuration directory on your VM instance, typically in
/etc/httpd/conf.d/
or/etc/apache2/conf.d
. For more information about enabling themod_status
plugin, 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/httpd/conf/httpd.conf
or/etc/apache2/apache2.conf
on 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
/etc/stackdriver/collectd.d/
:(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 Observability-provided Apache
mod_status
configuration, as root, editapache.conf
by following the instructions at the top of the file.Restart the monitoring agent:
sudo service stackdriver-agent restart
For more information on the collectd
apache
plugin, see
Plugin:Apache.
What is monitored
The full list of metrics the Apache plugin monitors is at Agent metrics: apache.