Choose the tarball corresponding to the specific NGINX version and CPU architecture.
Each release includes two tarballs per combination of NGINX version and CPU architecture.
The main tarball contains a single file, ngx_http_datadog_module.so, which is the Datadog NGINX module. The second one is debug symbols, it is optional.
For simplicity, the following script downloads only the module for the latest release:
get_latest_release(){ curl --silent "https://api.github.com/repos/$1/releases/latest"| jq --raw-output .tag_name
}get_architecture(){case"$(uname -m)" in
aarch64|arm64)echo"arm64";; x86_64|amd64)echo"amd64";; *)echo"";;esac}ARCH=$(get_architecture)if[ -z "$ARCH"];thenecho 1>&2"ERROR: Architecture $(uname -m) is not supported."exit1fiNGINX_VERSION="1.26.0"RELEASE_TAG=$(get_latest_release DataDog/nginx-datadog)TARBALL="ngx_http_datadog_module-${ARCH}-${NGINX_VERSION}.so.tgz"curl -Lo ${TARBALL}"https://github.com/DataDog/nginx-datadog/releases/download/${RELEASE_TAG}/${TARBALL}"
Extract the ngx_http_datadog_module.so file from the downloaded tarball using tar and place it in the NGINX modules directory, typically located at /usr/lib/nginx/modules.
NGINX configuration with Datadog module
In the topmost section of the NGINX configuration, load the Datadog module.
load_modulemodules/ngx_http_datadog_module.so;
The default configuration connects to a local Datadog Agent and produces traces
for all NGINX locations. Specify custom configuration using the dedicated
datadog_* directives described in the Datadog module’s API documentation.
For example, the following NGINX configuration sets the service name to
usage-internal-nginx and the sampling rate to 10%.
Datadog offers support for monitoring the Ingress-NGINX controller in Kubernetes.
Choose from the following instrumentation methods based on your controller version and requirements:
This instrumentation method uses nginx-datadog and leverages Kubernetes init-container mechanism
to install the module within the Ingress-NGINX Controller instance.
To instrument Ingress-NGINX v1.10.0+ using Datadog’s module, follow these steps:
1. Verify your Ingress-NGINX version Check your Ingress-NGINX Controller version and ensure you have the matching Datadog init-container available.
The init-container version (datadog/ingress-nginx-injection) must exactly match your controller version to prevent startup issues.
For example, if you’re running Ingress-NGINX v1.11.3, you need datadog/ingress-nginx-injection:v1.11.3.
2. Modify your controller’s pod specification Update the controller pod specification to include the init-container and configure the Datadog Agent host environment variable:
4. Apply the ConfigMap Apply the updated ConfigMap to ensure the Datadog module is correctly loaded.
This configuration ensures that the Datadog module is loaded and ready to trace incoming requests.
1. Verify your Ingress-NGINX version Check your Ingress-NGINX Controller version and ensure you have the matching Datadog init-container available.
The init-container version (datadog/ingress-nginx-injection) must exactly match your controller version to prevent startup issues.
For example, if you’re running Ingress-NGINX v1.11.3, you need datadog/ingress-nginx-injection:v1.11.3.
2. Overriding Helm chart values To customize the Ingress-NGINX Helm chart and load the required Datadog module, create a YAML file or modify an existing one with the following configuration:
values.yaml
controller:config:main-snippet:"load_module /modules_mount/ngx_http_datadog_module.so;"opentelemetry:enabled:falseextraModules:- name:nginx-datadogimage:registry:docker.ioimage:datadog/ingress-nginx-injection# The tag should match the version of the ingress-nginx controller# For example, this will inject the Datadog module for ingress v1.10.0# Check <https://hub.docker.com/repository/docker/datadog/ingress-nginx-injection/tags># for the list of all versions supported.tag:"v1.10.0"distroless:false
3. Deploy Install or upgrade the Helm release using the -f flag to apply the custom values created in the previous step.
1. Prepare the Datadog Agent Ensure that your Datadog Agent has gRPC OTLP Ingestion enabled to act as an OpenTelemetry Collector.
2. Configure the Ingress controller To begin, verify that your Ingress controller’s pod spec has the HOST_IP environment variable set. If not, add the following entry to the env block within the pod’s specification:
1. Prepare the Datadog Agent Ensure that your Datadog Agent has gRPC OTLP Ingestion enabled to act as an OpenTelemetry Collector.
2. Overriding Helm chart values To customize the Ingress-NGINX Helm chart and load the required Datadog module, create a YAML file or modify an existing one with the following configuration:
To enable Datadog tracing, create or edit a ConfigMap to set enable-opentracing: "true" and the datadog-collector-host to which traces should be sent.
The name of the ConfigMap is cited explicitly by the Ingress-NGINX Controller container’s command line argument, defaulting to --configmap=<POD_NAMESPACE>/nginx-configuration.
If ingress-nginx was installed via Helm chart, the ConfigMap’s name will follow the pattern <RELEASE_NAME>-nginx-ingress-controller.
The Ingress controller manages both the nginx.conf and /etc/nginx/opentracing.json files. Tracing is enabled for all location blocks.
Additionally, ensure that your controller’s pod spec has the HOST_IP environment variable set. Add this entry to the env: block that contains the environment variables POD_NAME and POD_NAMESPACE.