Are you starting with logging and monitoring from scratch?
Use Vector for the best experience with Better Stack.
Do you already have Datadog Agent installed?
Set up your Datadog Agent to send metrics to both Datadog and Better Stack. Change your /etc/datadog-agent/datadog.yaml
configuration file or set up environment variable:
additional_endpoints:
"https://in-datadog.logs.betterstack.com":
- "$SOURCE_TOKEN"
DD_ADDITIONAL_ENDPOINTS='{"https://in-datadog.logs.betterstack.com": ["$SOURCE_TOKEN"]}'
Using Datadog Agent to process logs?
Set up log forwarding to both Datadog and Better Stack. Change your /etc/datadog-agent/datadog.yaml
configuration file or set up 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_ENABLED=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}]'
Restart Datadog Agent for the new configuration to take effect:
sudo service datadog-agent restart
sudo systemctl restart datadog-agent
If you set up logs, you should see them in Better Stack → Live tail.
Check out your metrics in the Datadog Agent dashboard.
Are you starting with logging and monitoring from scratch?
Use Vector for the best experience with Better Stack.
Install and set up Datadog Agent on your machine:
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)"
You should see your metrics in the Datadog Agent dashboard.
Want to send logs to Better Stack using Datadog Agent?
Enable and configure your logging according to official Datadog documentation. For example, create new agent configuration in /etc/datadog-agent/conf.d/system.d/conf.yaml
to start sending your system logs:
mkdir -p /etc/datadog-agent/conf.d/system.d
cat > /etc/datadog-agent/conf.d/system.d/conf.yaml << YAML
logs:
- type: file
path: "/var/log/*.log"
service: "mysystem"
source: "system"
- type: file
path: "/var/log/*/*.log"
service: "mysystem"
source: "system"
YAML
Change the logs URL in /etc/datadog-agent/datadog.yaml
and enable them:
cat >> /etc/datadog-agent/datadog.yaml << YAML
logs_enabled: true
logs_config:
logs_dd_url: "https://in-datadog.logs.betterstack.com"
force_use_http: true
YAML
Restart Datadog Agent for the new configuration to take effect:
sudo service datadog-agent restart
sudo systemctl restart datadog-agent
You should see your logs in Better Stack → Live tail.
Check out your metrics in the Datadog Agent dashboard.
Please let us know at hello@betterstack.com.
We're happy to help! 🙏
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.