Better Stack Datadog Agent metrics & logs forwarding

Start monitoring in 2 minutes

1. Install Datadog Agent

Set up Datadog Agent using the official install script to send metrics:

Datadog Installation script
DD_URL="https://in-datadog.logs.betterstack.com" \
DD_API_KEY="$SOURCE_TOKEN" \
DD_HOSTNAME="$(hostname)" \
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"

2. (Optional) Enable log forwarding

To enable log forwarding exclusively to Better Stack, update the configuration file or use environment variables:

YAML config ENV variables
logs_enabled: true
logs_config:
  logs_dd_url: "in-datadog.logs.betterstack.com:443"
  force_use_http: true
DD_LOGS_ENABLED=true \
DD_LOGS_CONFIG_BETTERSTACK="in-datadog.logs.betterstack.com:443" \

3. Restart Datadog Agent

Restart the Datadog Agent to apply the new configuration:

Ubuntu, Debian CentOS, Red Hat
sudo service datadog-agent restart
sudo systemctl restart datadog-agent

4. Verify metrics and logs forwarding

Adjust existing Datadog Agent

Adjust Datadog Agent to send metrics and logs exclusively to Better Stack.

Update configuration

Update the /etc/datadog-agent/datadog.yaml file or use environment variables:

YAML config ENV variables
# Metrics configuration
additional_endpoints:
  "https://in-datadog.logs.betterstack.com":
    - "$SOURCE_TOKEN"

# Logs configuration (optional)
logs_enabled: true
logs_config:
  logs_dd_url: "in-datadog.logs.betterstack.com:443"
  force_use_http: true
# Metrics configuration
DD_ADDITIONAL_ENDPOINTS='{"https://in-datadog.logs.betterstack.com": ["$SOURCE_TOKEN"]}'

# Logs configuration (optional)
DD_LOGS_ENABLED=true \
DD_LOGS_CONFIG_BETTERSTACK="in-datadog.logs.betterstack.com:443" \

Can't find your datadog.yaml configuration?

Run datadog-agent status header and look into the Paths section for the Config File value.

Restart Datadog Agent

Restart the Datadog Agent to apply the new configuration:

Ubuntu, Debian CentOS, Red Hat
sudo service datadog-agent restart
sudo systemctl restart datadog-agent

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! 🙏