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:
cd /tmp && \
# Get latest release info using curl and basic text processing
RELEASE_DATA=$(curl -s https://api.github.com/repos/DataDog/httpd-datadog/releases/latest) && \
# Extract download URL for the zip file using grep and sed
DOWNLOAD_URL=$(echo "$RELEASE_DATA" | grep '"browser_download_url".*mod_datadog_artifact.zip' | sed 's/.*"browser_download_url": *"\([^"]*\)".*/\1/') && \
# Download and install
curl -Lf -o mod_datadog_artifact.zip "$DOWNLOAD_URL" && \
unzip -j mod_datadog_artifact.zip -d /usr/lib/apache2/modules/ && \
rm mod_datadog_artifact.zip
This script downloads the latest release artifact zip file, extracts the mod_datadog.so
shared library directly to the Apache modules directory, and cleans up the temporary files.
If you used a different installation method or need to place the file manually, ensure the mod_datadog.so
file is in the directory where HTTPd searches for modules, typically /usr/local/apache2/modules
or /usr/lib/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