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.

Note - the above is only relevant for agent 5. For restarting the agent process inside the agent 6 container, see instructions here - https://github.com/DataDog/datadog-agent/blob/a5be4f7cb45ff301283cbdda10d88d818394cd62/Dockerfiles/agent/SUPERVISION.md

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk