Instrumenting Apache HTTP Server
Datadog provides an HTTPd module to enhance Apache HTTP Server and IHS HTTP Server capabilities with APM Tracing.
Compatibility
Since IHS HTTP Server is essentially a wrapper of the Apache HTTP Server, the module can also be used with IHS without any modifications.
Installation
Note: Only Apache HTTP Server 2.4.x for x86_64 architecture is supported.
The module is provided as a shared library for dynamic loading by HTTPd. Each supported platform
and architecture has its own artifact hosted on httpd-datadog’s repository.
To install the module:
Run the following script to download the latest version of the module:
curl -s https://api.github.com/repos/DataDog/httpd-datadog/releases/latest \
| grep "mod_datadog-linux-x86_64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
When unpacking the tarball, the resulting file is mod_datadog.so
, the shared library that must
be loaded by the server.
Place the file in the directory where HTTPd searches for modules, typically /usr/local/apache2/modules
.
Load the module by adding the following line in the configuration file:
LoadModule datadog_module modules/mod_datadog.so
To enable the module, make sure to restart or reload HTTPd.
Configuration
By default, all requests are traced and sent to the Datadog Agent.
To change the module default behavior, use Datadog*
directives described in the Datadog module’s API documentation.
For example, the following configuration sets the service name to my-service
and the sampling rate to 10%:
LoadModule datadog_module modules/mod_datadog.so
DatadogServiceName my-app
DatadogSamplingRate 0.1
Further Reading
Additional helpful documentation, links, and articles: