Head over to datadoghq.com to get the official installation guide.
For a simple docker run, quickly get started with:
docker run -d -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_API_KEY=<YOUR_API_KEY> \ datadog/agent:latest
The Agent is highly customizable; here are the most used environment variables:
DD_API_KEY: your API key (required)
DD_HOSTNAME: hostname to use for metrics (if autodetection fails)
DD_TAGS: host tags, separated by spaces. For example:
These features are disabled by default for security or performance reasons, you need to explicitly enable them:
DD_APM_ENABLED: run the trace-agent along with the infrastructure Agent, allowing the container to accept traces on
DD_LOGS_ENABLED: run the log-agent along with the infrastructure Agent.
DD_PROCESS_AGENT_ENABLED: enable live process collection in the process-agent. The Live Container View is already enabled by default if the Docker socket is available
Send custom metrics via the statsd protocol:
DD_DOGSTATSD_NON_LOCAL_TRAFFIC: listen to DogStatsD packets from other containers, required to send custom metrics
DD_HISTOGRAM_PERCENTILES: histogram percentiles to compute, separated by spaces. The default is “0.95”
DD_HISTOGRAM_AGGREGATES: histogram aggregates to compute, separated by spaces. The default is “max median avg count”
DD_DOGSTATSD_SOCKET: path to the unix socket to listen to. Must be in a
DD_DOGSTATSD_ORIGIN_DETECTION: enable container detection and tagging for unix socket metrics.
DD_DOCKER_LABELS_AS_TAGS: extract docker container labels
DD_DOCKER_ENV_AS_TAGS: extract docker container environment variables
DD_KUBERNETES_POD_LABELS_AS_TAGS: extract pod labels
Either define them in your custom
datadog.yaml, or set them as JSON maps in these envvars. The map key is the source (
label/envvar) name, and the map value the datadog tag name.
Exclude containers from the metrics collection and Autodiscovery, if these are not useful for you. We already exclude Kubernetes and OpenShift
pause containers by default. See the
datadog.yaml.example file for more documentation, and examples:
DD_AC_INCLUDE: Space-separated strings of the whitelist of containers to always include e.g
DD_AC_EXCLUDE: Space-separated strings of the blacklist of containers to exclude e.g
.stopped.total metrics are not affected by these settings and always count all containers. This does not affect your per-container billing.