![]() |
VOOZH | about |
The Datadog Docker Agent is a version of the Datadog Agent that supports Docker, containerd, and Podman runtimes. For supported Docker versions, see Supported Platforms.
Follow the in-app installation flow in Datadog. This is the recommended flow, which helps you create your docker run command with your API key, the required minimum configurations, and toggles for various Datadog features.
The Fleet Automation flow helps configure your Datadog Agent container with Datadog’s recommended instructions. To configure this manually, see the examples below.
Use the following command to run the Agent as a Docker container once on each host you want to monitor. Replace <DATADOG_API_KEY> with your Datadog API key and <DATADOG_SITE> with your .
docker run -d --cgroupns host --pid host --name dd-agent \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-e DD_SITE=<DATADOG_SITE> \
-e DD_API_KEY=<DATADOG_API_KEY> \
registry.datadoghq.com/agent:7
The Datadog Agent is supported on Windows Server 2019 (LTSC) and Windows Server 2022 (LTSC). The following PowerShell command runs the Datadog Agent container:
docker run -d --name dd-agent `
-v \\.\pipe\docker_engine:\\.\pipe\docker_engine `
-e DD_SITE=<DATADOG_SITE> `
-e DD_API_KEY=<DATADOG_API_KEY> `
registry.datadoghq.com/agent:7
Note: For Docker Compose, see Compose and the Datadog Agent. For deploying the Agent in Podman, see the instructions in Using the Docker integration with Podman container runtime.
After the Datadog Docker Agent is up and running, you can configure Datadog integrations to collect metrics and logs automatically from your application containers. Datadog’s Container Autodiscovery enables you to define monitoring configuration for dynamic resources in containerized systems.
Images are available for 64-bit x86 and Arm v8 architectures. Datadog publishes container images to the Datadog Container Registry, Google Artifact Registry (GAR), Amazon ECR, Azure ACR, and Docker Hub:
| Registry | Path |
|---|---|
| Datadog Container Registry | registry.datadoghq.com |
| Google Artifact Registry | gcr.io/datadoghq |
| Google Artifact Registry (Europe) | eu.gcr.io/datadoghq |
| Google Artifact Registry (Asia) | asia.gcr.io/datadoghq |
| Amazon ECR | public.ecr.aws/datadog |
| Azure ACR | datadoghq.azurecr.io |
| Docker Hub | docker.io/datadog |
By default, the above instructions pull the image from the Datadog Container Registry (registry.datadoghq.com). If you use this registry, ensure your firewall allows traffic to us-docker.pkg.dev/datadog-prod/public-images, as the registry may redirect requests to this URL.
In a non-containerized environment, configuration options for the Datadog Agent are set in datadog.yaml. For the Datadog Docker Agent, you can set datadog.yaml configuration options through environment variables.
DD_API_KEYDD_ENVenv tag for all data emitted.DD_HOSTNAMEDD_HOSTNAME_FILEDD_HOSTNAME is set to a non-empty value, this option is ignored.DD_TAGSkey1:value1 key2:value2.DD_SITE. Defaults to datadoghq.com.DD_DD_URLDD_URL (6.36+/7.36+)DD_DD_URL. Ignored if DD_DD_URL is already set.DD_CHECK_RUNNERS4 runners). To run the checks sequentially, set the value to 1. If you need to run a high number of checks (or slow checks), the collector-queue component may fall behind and fail the health check. You can increase the number of runners to run checks in parallel.DD_APM_ENABLEDtrue. For more information about additional trace collection environment variables, see Tracing Docker Applications.DD_LOGS_CONFIG_EXPECTED_TAGS_DURATION"10m".Starting with Agent v6.4.0 (and v6.5.0 for the Trace Agent), you can override the Agent proxy settings with the following environment variables:
DD_PROXY_HTTPhttp requests.DD_PROXY_HTTPShttps requests.DD_PROXY_NO_PROXYFor more information about proxy settings, see the Agent v6 Proxy documentation.
Optional collection Agents are disabled by default for security or performance reasons. Use these environment variables to enable them:
DD_APM_NON_LOCAL_TRAFFICDD_LOGS_ENABLEDDD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLEDSend custom metrics with the StatsD protocol:
DD_DOGSTATSD_NON_LOCAL_TRAFFICDD_HISTOGRAM_PERCENTILES0.95.DD_HISTOGRAM_AGGREGATES"max median avg count".DD_DOGSTATSD_SOCKETrw mounted volume.DD_DOGSTATSD_ORIGIN_DETECTIONDD_DOGSTATSD_TAGS"env:golden group:retrievers".DD_USE_DOGSTATSDAs a best practice, Datadog recommends using unified service tagging when assigning tags.
Datadog automatically collects common tags from Docker, Kubernetes, ECS, Swarm, Mesos, Nomad, and Rancher. To extract even more tags, use the following options:
DD_CONTAINER_LABELS_AS_TAGSDD_DOCKER_LABELS_AS_TAGS.DD_CONTAINER_ENV_AS_TAGSDD_DOCKER_ENV_AS_TAGS.DD_COLLECT_EC2_TAGSSee the Docker Tag Extraction documentation to learn more.
Integration credentials can be stored in Docker or Kubernetes secrets and used in Autodiscovery templates. For more information, see the Secrets Management documentation.
Exclude containers from logs collection, metrics collection, and Autodiscovery. Datadog excludes Kubernetes and OpenShift pause containers by default. These allowlists and blocklists apply to Autodiscovery only; traces and DogStatsD are not affected. The value for these environment variables support regular expressions.
DD_CONTAINER_INCLUDE.* to include all. For example: "image:image_name_1 image:image_name_2", image:.* When using ImageStreams inside OpenShift environments, use the container name instead of image. For example: "name:container_name_1 name:container_name_2", name:.*DD_CONTAINER_EXCLUDE.* to exclude all. For example: "image:image_name_3 image:image_name_4", image:.* (Note: This variable is only honored for Autodiscovery.)DD_CONTAINER_INCLUDE_METRICSDD_CONTAINER_EXCLUDE_METRICSDD_CONTAINER_INCLUDE_LOGSDD_CONTAINER_EXCLUDE_LOGSDD_AC_INCLUDE.* to include all. For example: "image:image_name_1 image:image_name_2", image:.*DD_AC_EXCLUDE.* to exclude all. For example: "image:image_name_3 image:image_name_4", image:.* (Note: This variable is only honored for Autodiscovery.)Additional examples are available on the Container Discovery Management page.
Note: The kubernetes.containers.running, kubernetes.pods.running, docker.containers.running, .stopped, .running.total and .stopped.total metrics are not affected by these settings. All containers are counted. This does not affect your per-container billing.
Note: When using containerd, it’s possible to ignore containers by namespace using DD_CONTAINERD_NAMESPACES and DD_CONTAINERD_EXCLUDE_NAMESPACES. Both are a space-separated list of namespaces. When DD_CONTAINERD_NAMESPACES is set, the agent reports data for the containers that belong to a namespace present in the list. When DD_CONTAINERD_EXCLUDE_NAMESPACES is set, the agent reports data for all the containers except the ones that belong to a namespace of the list.
DD_LISTENERSDD_EXTRA_LISTENERSlisteners section of the datadog.yaml configuration file.DD_CONFIG_PROVIDERSdocker. The Docker provider handles templates embedded in container labels.DD_EXTRA_CONFIG_PROVIDERSconfig_providers section of the datadog.yaml configuration file.DD_PROCESS_AGENT_CONTAINER_SOURCE"docker", "ecs_fargate", "kubelet". This is no longer needed since Agent v7.35.0.DD_HEALTH_PORT5555 to expose the Agent health check at port 5555.See the Agent Commands guides to discover all the Docker Agent commands.
By default, the Docker Agent collects metrics with the following core checks. To collect metrics from other technologies, see the Integrations section.
| Check | Metrics |
|---|---|
| Container | Metrics |
| CPU | System |
| Disk | Disk |
| Docker | Docker |
| File Handle | System |
| IO | System |
| Load | System |
| Memory | System |
| Network | Network |
| NTP | NTP |
| Uptime | System |
The Docker Agent sends events to Datadog when an Agent is started or restarted.
datadog.agent.up
Returns CRITICAL if the Agent is unable to connect to Datadog, otherwise returns OK.
datadog.agent.check_status
Returns CRITICAL if an Agent check is unable to send metrics to Datadog, otherwise returns OK.
If you installed the Datadog Docker Agent with Single Step APM Instrumentation, and you want to uninstall the Agent, you need to run additional commands to uninstall APM Instrumentation.
Additional helpful documentation, links, and articles:
| |