This document is a guide to running the profiler in a Docker container.
The datadog-agent must be running and configured to collect APM data (this is enabled by default in the agent, unless you explicitly disabled it). See https://docs.datadoghq.com/containers/docker/apm/ for more information.
For the purposes of this guide, we assume that the datadog agent is accessible at a specific address from the docker container: http://<agent_address>:8126.
See https://github.com/DataDog/dd-otel-host-profiler/pkgs/container/dd-otel-host-profiler/ for a container image that can be used to run the profiler.
To run the profiler in Docker, you should ensure the following requirements are met (see example below):
- The container has host PID enabled.
- The container is running in privileged mode.
- The container has the
SYS_ADMINcapability. - The
DD_TRACE_AGENT_URLenvironment variable is set to the address of the Datadog agent:http://<agent_address>:8126. - To enable the profiler to upload debug symbols when they're available locally (required to have function names for compiled languages like C/C++/Rust/Go/...), you must configure:
- The
DD_SITEenvironment variable to your Datadog site (e.g.datadoghq.com,datadoghq.eu,us5.datadoghq.com, ...). - The
DD_API_KEYenvironment variable to your Datadog API key.
- The
docker run \
--pid=host \
--privileged \
--cap-add=SYS_ADMIN \
-e DD_TRACE_AGENT_URL=http://<agent_address>:8126 \
-e DD_SERVICE="dd-otel-host-profiler" \
-e DD_SITE="YOUR_DATADOG_SITE" \
-e DD_API_KEY="YOUR_DATADOG_API_KEY" \
ghcr.io/datadog/dd-otel-host-profiler:latest