Overview Datadog Agent for Docker
The Datadog Agent for Docker enables you to collect metrics, logs, and events from your containerized applications and send them to Kloudfuse for observability. This integration allows you to monitor Docker container performance and application behavior by deploying the Datadog agent container alongside your services. Use this feature to gain visibility into your Docker environments with minimal configuration.
Basic Datadog Deployment on Docker Environments
Use the following steps to integrate Datadog agent with Docker container services.
-
Add the following
datadog serviceentry in the existingdocker-compose.yaml:datadog: build: datadog container_name: datadog-agent #replace with anything specific to environment. links: - <<service>> # Add appropriate service links environment: - DD_API_KEY=temp_api_key - DD_CONTAINER_EXCLUDE=name:datadog-agent # OPTIONAL To exclude datadog agent logs to be sent to Kloudfuse volumes: - /var/run/docker.sock:/var/run/docker.sock - /proc/:/host/proc/:ro - /sys/fs/cgroup:/host/sys/fs/cgroup:ro - /var/lib/docker/containers:/var/lib/docker/containers:royaml -
Create a directory
datadogto build the datadog agent image. -
Create a
datadog.yamlfile in thedatadogdirectory to configure the agent to send data to the Kloudfuse ingester.api_key: temp_api_key site: datadoghq.com dd_url: "http://<URL>/ingester" # Use http or https depending on whether HTTPS/TLS is configured on Kloudfuse skip_ssl_validation: true # Skip this if you do not want to skip the SSL/TLS validation logs_enabled: true logs_config: logs_dd_url: "URL:80" # Use port 443 if HTTPS/TLS is enabled use_http: true logs_no_ssl: true # Set to false if HTTPS/TLS is enabled auto_multi_line_detection: false use_v2_api: false container_collect_all: true apm_config: enabled: true apm_dd_url: "URL:80/ingester" # User port 443 if HTTPS/TLS is enabled process_config: process_dd_url: "http://URL/ingester" # Use http or https depending on whether HTTPS/TLS is configured on Kloudfuse events_dd_url: "http://URL/ingester" # Use http or https depending on whether HTTPS/TLS is configured on Kloudfuse container_collection: enabled: false metadata_providers: - name: host interval: 300 use_v2_api: series: trueyaml -
Create a
Dockerfilein thedatadogdirectory.FROM gcr.io/datadoghq/agent:7 ADD datadog.yaml /etc/datadog-agent/datadog.yaml -
Add the necessary yaml files to the
conf.ddirectory. -
Build the datadog agent image.
docker-compose build -
Update your current deployment to use the Datadog agent container to send Metrics, Logs, and Events data to Kloudfuse.
docker compose up -d
Adding Custom Tags
Add custom tags to the agent for all metrics, logs, and events collected by the agent. Follow these steps.
-
Update the
environmentsection of datadog in docker-compose.yml file to include following code.datadog: ... environment: ... - DD_TAG=custom_tag_name:custom_tag_valueyaml -
The Kloudfuse helm
custom-values.yamlfile must list the custom tags.ingester: config: hostTagIncludes: ... - custom_tag_name (1) ...yaml1 custom_tag_name: Add all custom tag names; otherwise, the system may overwrite existing configurations. -
Alternatively, if you don’t plan to maintain a long list of possible custom tags, set
allowAllHostTagstotrue. This effectively adds all extracted custom tags to the allow list.ingester: config: allowAllHostTags: true (1)yaml1 allowAllHostTags: Adds all custom tag names to the allow list; otherwise, the system may overwrite existing configurations.