Skip to content

Datadog Agent Not Reporting Metrics Fix

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Datadog Agent Not Reporting Metrics Fix. We cover key concepts, practical examples, and best practices.

The Datadog Agent shows Not running or No data in last 24 hours — the agent process isn't running, the API key is invalid, or the agent can't reach the Datadog intake endpoint.

The Problem

datadog-agent status
==========
Agent (v7.52.0)
==========
  Status date: 2026-06-24 10:00:00
  Agent start: 2026-06-20 08:00:00
  Pid: 12345
  Path: /opt/datadog-agent/bin/agent/agent
  Logs: /var/log/datadog/agent.log

  API Key: Last 5 chars: abc12
  API Key status: API Key is invalid

The API key is invalid or revoked. Datadog rejects all data from this agent.

Step-by-Step Fix

1. Verify the API key

# Check API key validity
datadog-agent config | grep api_key

# Test the API key against Datadog
curl -X GET "https://api.datadoghq.com/api/v1/validate" \
  -H "DD-API-KEY: $(grep api_key /etc/datadog-agent/datadog.yaml | awk '{print $2}')"

2. Restart the agent

sudo systemctl restart datadog-agent
sudo datadog-agent status

3. Check network connectivity

# Test connection to Datadog intake
curl -v https://intake.datadoghq.com/api/v1/series

# For EU region
curl -v https://app.datadoghq.eu/api/v1/series

# Check proxy configuration in datadog.yaml
grep -A 3 proxy: /etc/datadog-agent/datadog.yaml

4. Check agent logs for errors

# Recent errors
sudo journalctl -u datadog-agent --since "1 hour ago" | grep -i error

# Agent log file
tail -50 /var/log/datadog/agent.log

5. Verify integrations are configured

# /etc/datadog-agent/conf.d/redisdb.d/conf.yaml
init_config:

instances:
  - host: localhost
    port: 6379
    password: myredispass

Run <a href="/devops/monitoring-tools/">datadog</a>-agent check redisdb to test an integration.

Expected output:

datadog-agent status
==========
API Key: Last 5 chars: xyz78
API Key status: API Key is valid

Metrics: 0.0 B / 10.0 B (0.0%)
Events: 0.0 B / 1.0 MB (0.0%)
Series: 0.0 B / 10.0 B (0.0%)

=== Running Checks ===
  cpu (5.43.0)
    - 1 OK
  disk (5.43.0)
    - 1 OK

Prevention Tips

  • Rotate API keys regularly and update <a href="/devops/monitoring-tools/">datadog</a>.yaml
  • Use Datadog Agent v7 for the latest features
  • Configure proxy settings if behind a corporate firewall
  • Set up Datadog Agent in Docker/K8s with environment variables
  • Monitor agent status with a Datadog dashboard

Common Mistakes with agent not reporting

  1. Using head and tail instead of pattern matching, causing runtime errors on empty lists
  2. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  3. Using return to exit a function early instead of wrapping a pure value in the monad

These mistakes appear frequently in real-world DATADOG code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does the Datadog Agent say "API Key is invalid"?

The API key was deleted from Datadog, rotated, or has the wrong site. Check <a href="/devops/monitoring-tools/">datadog</a>.yaml for the correct site (e.g., datadoghq.com vs datadoghq.eu). Run <a href="/devops/monitoring-tools/">datadog</a>-agent config to see the API key (last 5 chars) and verify it in Datadog under Organization Settings > API Keys.

How do I fix "No data in last 24 hours" on the Datadog host map?

The agent might be running but not sending data. Check journalctl -u <a href="/devops/monitoring-tools/">datadog</a>-agent for errors. Run <a href="/devops/monitoring-tools/">datadog</a>-agent health to see the agent's health. If the agent is checking integrations but no data arrives, check the Datadog intake URL matches your site region.

Can I run multiple Datadog Agents on one host?

Yes, but each agent needs a distinct configuration with unique hostnames, ports, and API keys. Use DD_HOSTNAME and DD_API_KEY environment variables. Only one agent should be the "main" agent collecting system metrics.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro