📌 Datadog Agent Debugging Checklist for Docker Containers
If your Datadog Agent is running as a Docker container but your metrics or logs are missing from the Datadog UI, follow this guide to diagnose and resolve the issue efficiently.
1️⃣ Verify Datadog Agent Container is Running
Run the following command to check if the Datadog Agent container is active:
docker ps | grep datadog-agent
✅ Expected Output:
CONTAINER ID IMAGE COMMAND STATUS NAMES
abcdef123456 gcr.io/datadoghq/agent:7 '/bin/entrypoint.sh' Up X minutes datadog-agent
🚨 If the container is not running, restart it:
docker-compose -f /opt/datadog/docker-compose.yml up -d
2️⃣ Check Datadog Agent Logs
To review logs for potential issues:
docker logs --tail 50 datadog-agent
✅ Look for messages related to:
- API key authentication failures
- Connection refused errors
- Failure to reach Datadog servers
🚨 If errors appear, check environment variables in your docker-compose.yml
.
3️⃣ Verify API Key & Connectivity
Ensure the API key is correctly set inside the container:
docker exec -it datadog-agent env | grep DD_API_KEY
Then, test connectivity manually:
docker exec -it datadog-agent sh -c 'curl -v "https://api.datadoghq.com/api/v1/validate?api_key=$DD_API_KEY"'
✅ Expected Response (200 OK
):
{"valid":true}
🚨 If response is 403 Forbidden
or 401 Unauthorized
, the API key is incorrect. Verify and update it in your docker-compose.yml
.
4️⃣ Ensure Datadog Agent Can Reach Datadog Servers
docker exec -it datadog-agent curl -v https://app.datadoghq.com
✅ Expected Output: No Connection refused
or Timeout
errors.
🚨 If blocked, allow outbound traffic:
sudo ufw allow out to api.datadoghq.com
5️⃣ Verify Datadog Agent is Sending Data
docker exec -it datadog-agent agent status | grep -A10 "Forwarder"
✅ Look for:
Transactions flushed: successfully: X, errors: 0
🚨 If errors: X
appears, the agent is not sending data. Restart it:
docker-compose -f /opt/datadog/docker-compose.yml restart datadog-agent
6️⃣ Manually Send a Test Metric
If the agent is running but not visible, manually send a test metric:
docker exec -it datadog-agent agent telemetry send test.metric 1
✅ Check in Datadog UI → Metrics Explorer and search for test.metric
.
📌 Summary of Debugging Steps
Check | Command | Expected Result | |
---|---|---|---|
Container is running | `docker ps | grep datadog-agent` | Container is running |
Check logs for errors | docker logs --tail 50 datadog-agent |
No connection/auth errors | |
Verify API key | `docker exec -it datadog-agent env | grep DD_API_KEY` | Correct API key is set |
Test Datadog connectivity | docker exec -it datadog-agent sh -c 'curl -v "https://api.datadoghq.com/api/v1/validate?api_key=$DD_API_KEY"' |
No network errors | |
Check agent network reachability | docker exec -it datadog-agent curl -v https://app.datadoghq.com |
Successful connection | |
Ensure metrics are sent | `docker exec -it datadog-agent agent status | grep -A10 "Forwarder"` | No errors in transactions |
Manually send a test metric | docker exec -it datadog-agent agent telemetry send test.metric 1 |
Appears in Datadog UI |
🚀 Follow these steps to ensure your Docker-based Datadog Agent is properly configured! Need more help? Drop a comment or reach out! 🚀
Top comments (0)