Use the Datadog Agent for Log Collection Only

Infrastructure Monitoring is a prerequisite to using APM. If you are an APM customer, do not turn off metric collection or you might lose critical telemetry and metric collection information.

To disable payloads, you must be running Agent v6.4+. This disables metric data submission (including Custom Metrics) so that hosts stop showing up in Datadog. Follow these steps:

  1. Open the datadog.yaml configuration file.

  2. Add the enable_payloads attribute with the following settings:

    enable_payloads:
        series: false
        events: false
        service_checks: false
        sketches: false
    
  3. Configure the Agent to collect Logs.

  4. Restart the Agent.

If you’re using the Docker containerized Agent, set the following environment variables to false:

  • DD_ENABLE_PAYLOADS_EVENTS
  • DD_ENABLE_PAYLOADS_SERIES
  • DD_ENABLE_PAYLOADS_SERVICE_CHECKS
  • DD_ENABLE_PAYLOADS_SKETCHES

Here’s an example of how you can include these settings in your Docker run command:

docker run -d --name datadog-agent \
           --cgroupns host \
           --pid host \
           -e DD_API_KEY=<DATADOG_API_KEY> \
           -e DD_LOGS_ENABLED=true \
           -e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \
           -e DD_CONTAINER_EXCLUDE="name:datadog-agent" \
           -e DD_ENABLE_PAYLOADS_EVENTS=false \
           -e DD_ENABLE_PAYLOADS_SERIES=false \
           -e DD_ENABLE_PAYLOADS_SERVICE_CHECKS=false \
           -e DD_ENABLE_PAYLOADS_SKETCHES=false \
           -v /var/run/docker.sock:/var/run/docker.sock:ro \
           -v /proc/:/host/proc/:ro \
           -v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
           -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
           gcr.io/datadoghq/agent:latest

If you’re deploying the Agent in Kubernetes, make the following changes in your Helm chart in addition to your Agent configuration:

 ## Send logs only
clusterAgent:
  enabled: false
datadog:
[...]
  processAgent:
    enabled: false
[...]
  env:
    - name: DD_ENABLE_PAYLOADS_EVENTS
      value: "false"
    - name: DD_ENABLE_PAYLOADS_SERIES
      value: "false"
    - name: DD_ENABLE_PAYLOADS_SERVICE_CHECKS
      value: "false"
    - name: DD_ENABLE_PAYLOADS_SKETCHES
      value: "false"

Further reading

Additional helpful documentation, links, and articles: