Explore documentation
Better Stack Datadog Agent Logging
Start logging in 2 minutes
Where do you need to send your metrics and logs?
Send data only to Better Stack
1. Install Datadog Agent
Install and set up Datadog Agent on your machine:
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
2. Set up sending metrics
Set up your Datadog Agent to send metrics to Better Stack. Use datadog.yaml
configuration file or environment variables and change the default values:
dd_url: "https://in-datadog.logs.betterstack.com"
api_key: "$SOURCE_TOKEN"
DD_URL=https://in-datadog.logs.betterstack.com
DD_API_KEY=$SOURCE_TOKEN
3. Set up sending logs
Using Datadog Agent to process logs? Set it up to send the logs to Better Stack. Use datadog.yaml
configuration file or environment variables:
logs_enabled: true
logs_config:
logs_dd_url: "https://in-datadog.logs.betterstack.com"
DD_LOGS_CONFIG_DD_URL=https://in-datadog.logs.betterstack.com
4. Restart Datadog Agent
Restart Datadog Agent for the new configuration to take effect:
sudo service datadog-agent restart
sudo systemctl restart datadog-agent
Send data to both Better Stack and Datadog
1. Install Datadog Agent
Install and set up Datadog Agent on your machine:
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
2. Set up metrics forwarding
Set up your Datadog Agent to send metrics to both Datadog and Better Stack. Use datadog.yaml
configuration file or environment variables:
additional_endpoints:
"https://in-datadog.logs.betterstack.com":
- "$SOURCE_TOKEN"
DD_ADDITIONAL_ENDPOINTS='{"https://in-datadog.logs.betterstack.com": ["$SOURCE_TOKEN"]}'
3. Set up logs forwarding
Using Datadog Agent to process logs? Set up log forwarding to both Datadog and Better Stack. Use datadog.yaml
configuration file or environment variables:
logs_enabled: true
logs_config:
use_http: true
additional_endpoints:
- Host: "in-datadog.logs.betterstack.com"
Port: 443
api_key: "$SOURCE_TOKEN"
is_reliable: true
DD_LOGS_CONFIG_USE_HTTP=true
DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS='[{"Host": "in-datadog.logs.betterstack.com", "Port": 443, "api_key": "$SOURCE_TOKEN", "is_reliable": true}]'
4. Restart Datadog Agent
Restart Datadog Agent for the new configuration to take effect:
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! 🙏
Additional information
To help you locate your main configuration file, see Datadog Agent configuration files docs.
Want to read about Datadog Agent data forwarding in more detail?
Check out the Datadog Agent dual shipping page.