Obtaining debug logs from the container agent

It isn't possible to restart the container agent with service datadog-agent restart or similar, because those commands will cause the container to be killed by Docker (presumably due to a failed health check). Thus, in order to restart the container agent, one must use supervisor:

/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all

The following commands will enable debug logging, restart the agent, wait 60 seconds, then send a flare:

sed -i '/\[Main\]/a LOG_LEVEL=DEBUG' /etc/dd-agent/datadog.conf
/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all
sleep 60
/etc/init.d/datadog-agent flare <CASE_ID>

Debug logs can be disabled with:

sed -i '/LOG_LEVEL=DEBUG/d' /etc/dd-agent/datadog.conf
/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf restart all

Or the container can be restarted.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk