The Datadog integration instance configuration error means the Datadog agent on a host can’t communicate with the Datadog API to send metrics or logs. This usually happens because of a network issue, incorrect credentials, or a misconfigured agent.

Common Causes and Fixes

  1. Network Connectivity to Datadog API: The agent can’t reach api.datadoghq.com (or your regional equivalent).

    • Diagnosis: On the affected host, run curl -v https://api.datadoghq.com/api/v1/validate. Look for a successful HTTP 200 response or a specific error message.
    • Fix: Ensure your firewall rules allow outbound traffic on port 443 to api.datadoghq.com. If you’re behind a proxy, configure the Datadog agent to use it. Edit datadog.yaml (usually located at /etc/datadog-agent/datadog.yaml on Linux or C:\ProgramData\Datadog\datadog.yaml on Windows) and add/uncomment these lines:
      proxy:
        http: http://your_proxy_address:proxy_port
        https: https://your_proxy_address:proxy_port
      
      Restart the agent: sudo systemctl restart datadog-agent (Linux) or Restart-Service datadogagent (Windows PowerShell).
    • Why it works: This ensures the agent can establish a secure TLS connection to Datadog’s API endpoints.
  2. Invalid API Key: The API key configured in the agent is incorrect or has been revoked.

    • Diagnosis: Check the datadog.yaml file for the api_key setting. Compare it character-for-character with the API key found in your Datadog account settings under "Organization Settings" -> "API Keys".
    • Fix: Update the api_key in datadog.yaml to the correct value:
      api_key: YOUR_CORRECT_API_KEY
      
      Restart the agent.
    • Why it works: The API key is the primary authentication mechanism for the agent to identify itself to Datadog.
  3. Invalid Application Key (Less Common for Basic Metrics): If you’re using specific integrations that require an application key for advanced features or data retrieval, an invalid one will cause errors.

    • Diagnosis: Check datadog.yaml for app_key. Compare it with an active application key in Datadog under "Organization Settings" -> "Application Keys". Ensure the application key has the necessary permissions for the integration in question.
    • Fix: Update the app_key in datadog.yaml to the correct, active application key.
      app_key: YOUR_CORRECT_APP_KEY
      
      Restart the agent.
    • Why it works: Application keys provide granular, scoped permissions for specific integrations or programmatic access, distinct from the global API key.
  4. Datadog Agent Service Not Running: The Datadog agent process is not active on the host.

    • Diagnosis: On Linux, run sudo systemctl status datadog-agent. On Windows, check the "Services" console for "Datadog Agent" and its status.
    • Fix: Start the service: sudo systemctl start datadog-agent (Linux) or Start-Service datadogagent (Windows PowerShell). If it fails to start, check system logs (journalctl -u datadog-agent on Linux) for clues.
    • Why it works: The agent must be running as a service to collect and send data.
  5. Agent Configuration File Permissions: The Datadog agent process doesn’t have read access to its configuration file (datadog.yaml).

    • Diagnosis: On Linux, run ls -l /etc/datadog-agent/datadog.yaml. Check the owner and permissions. The agent typically runs as the dd-agent user.
    • Fix: Ensure the file is readable by the user the agent runs as. For example: sudo chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml and sudo chmod 640 /etc/datadog-agent/datadog.yaml. Restart the agent.
    • Why it works: The agent process needs to read its configuration to know its API key, site, proxy settings, and which integrations to load.
  6. Conflicting Agent Configuration (e.g., Multiple sites defined): The datadog.yaml file might have syntax errors or conflicting directives, preventing it from loading correctly.

    • Diagnosis: Carefully review datadog.yaml for any syntax errors, especially around YAML indentation. Ensure only one site directive is present if you’re using the default US1 site (datadog.com). If using a different region, it should be site: datadoghq.eu, site: datadoghq.ca, etc.
    • Fix: Correct any YAML syntax errors and ensure the site directive is correctly specified for your Datadog account’s region. For example, for the EU site:
      site: datadoghq.eu
      
      Restart the agent.
    • Why it works: YAML is whitespace-sensitive, and incorrect formatting can lead to parsing errors. The site directive tells the agent which Datadog endpoint to communicate with.
  7. Datadog Agent Version Incompatibility: An older agent version might not be compatible with recent API changes or security protocols.

    • Diagnosis: Check the agent version: datadog-agent --version. Compare this to the latest recommended version for your operating system.
    • Fix: Upgrade the Datadog agent to the latest stable version. Follow the official Datadog upgrade instructions for your OS. For example, on Ubuntu/Debian: sudo apt-get update && sudo apt-get install datadog-agent. Restart the agent after upgrading.
    • Why it works: Newer agent versions include updated libraries and features necessary to communicate with Datadog’s evolving infrastructure and security standards.

The next error you’ll likely encounter, if you haven’t already, is a "Check initialization error" for specific integrations, as the agent is now able to communicate but individual checks might be failing due to their own configuration issues.

Want structured learning?

Take the full Datadog course →