The Apache check tracks requests per second, bytes served, number of worker threads, service uptime, and more.
The Apache check is packaged with the Agent. To start gathering your Apache metrics and logs, you need to:
Install the Agent on your Apache servers.
Install mod_status
on your Apache servers and enable ExtendedStatus
.
To configure this check for an Agent running on a host:
Edit the apache.d/conf.yaml
file in the conf.d/
folder at the root of your Agent’s configuration directory to start collecting your Apache metrics. See the sample apache.d/conf.yaml for all available configuration options.
init_config:
instances:
## @param apache_status_url - string - required
## Status url of your Apache server.
#
- apache_status_url: http://localhost/server-status?auto
Available for Agent versions >6.0
Collecting logs is disabled by default in the Datadog Agent, you need to enable it in datadog.yaml
:
logs_enabled: true
Add this configuration block to your apache.d/conf.yaml
file to start collecting your Apache Logs:
logs:
- type: file
path: /var/log/apache2/access.log
source: apache
service: apache
- type: file
path: /var/log/apache2/error.log
source: apache
service: apache
Change the path
and service
parameter values and configure them for your environment. See the sample apache.d/conf.yaml for all available configuration options.
For containerized environments, see the Autodiscovery Integration Templates for guidance on applying the parameters below.
Parameter | Value |
---|---|
<INTEGRATION_NAME> | apache |
<INIT_CONFIG> | blank or {} |
<INSTANCE_CONFIG> | {"apache_status_url": "http://%%host%%/server-status?auto"} |
Available for Agent versions >6.0
Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes log collection documentation.
Parameter | Value |
---|---|
<LOG_CONFIG> | {"source": "apache", "service": "<SERVICE_NAME>"} |
Run the Agent’s status subcommand and look for apache
under the Checks section.
apache.conns_total (gauge) | The total number of connections performed. Shown as connection |
apache.conns_async_writing (gauge) | The number of asynchronous writes connections. Shown as connection |
apache.conns_async_keep_alive (gauge) | The number of asynchronous keep alive connections. Shown as connection |
apache.conns_async_closing (gauge) | The number of asynchronous closing connections. Shown as connection |
apache.net.bytes (gauge) | The total number of bytes served. Shown as byte |
apache.net.bytes_per_s (gauge) | The number of bytes served per second. Shown as byte |
apache.net.hits (gauge) | The total number of requests performed. Shown as request |
apache.net.request_per_s (gauge) | The number of requests performed per second. Shown as request |
apache.performance.cpu_load (gauge) | The percent of CPU used. Shown as percent |
apache.performance.busy_workers (gauge) | The number of workers serving requests. Shown as thread |
apache.performance.idle_workers (gauge) | The number of idle workers. Shown as thread |
apache.performance.uptime (gauge) | The amount of time the server has been running. Shown as second |
The Apache check does not include any events.
apache.can_connect:
Returns CRITICAL
if the Agent cannot connect to the configured apache_status_url
, otherwise returns OK
.
If you are having issues with your Apache integration, it is mostly like due to the Agent not being able to access your Apache status URL. Try running curl for the apache_status_url
listed in your apache.d/conf.yaml
file (include your login credentials if applicable).
Additional helpful documentation, links, and articles:
On this Page