datadog.yaml
datadog.yaml is the main configuration file where you write the settings for the Datadog Agent itself. It holds items that affect the whole Agent, such as the API key, destination site, hostname, tags, and enabling log collection, while the settings for individual integrations live in the separate conf.d directory.
Overview
datadog.yaml is the main configuration file that the Datadog Agent reads at startup. Its location is fixed per OS: under /etc/datadog-agent/ on Linux, /opt/datadog-agent/etc/ on macOS, and %ProgramData%\Datadog on Windows. The same items can be overridden with DD_ environment variables, and in container environments the standard practice is to pass them as environment variables rather than editing the file. You care about it when deciding the destination and key right after installing the Agent, and when the Agent is running but data is not arriving.
The Agent's own settings gather in one file
datadog.yaml is the main configuration file where you write the settings for the Datadog Agent itself. Items that affect the whole Agent go here: the API key, destination site, hostname, tags, and whether log collection is on. The official documentation calls this file the Agent's main configuration file. It explains that check and integration settings go in the separate conf.d directory (as of September 2026; Source: Agent Configuration Files). The division is: "how the Agent itself runs" is datadog.yaml, and "what to monitor" is under conf.d. If you do not know this division, you end up lost in the way of writing a monitoring target's connection details into this file and collecting nothing.
Where it lives - per-OS locations and the split with conf.d
The location is fixed per OS (as of September 2026; Source: Agent Configuration Files).
| OS | datadog.yaml | conf.d |
|---|---|---|
| Linux (same for AIX) | /etc/datadog-agent/datadog.yaml | /etc/datadog-agent/conf.d/ |
| macOS | /opt/datadog-agent/etc/datadog.yaml | /opt/datadog-agent/etc/conf.d/ |
| Windows | %ProgramData%\Datadog\datadog.yaml | %ProgramData%\Datadog\conf.d |
Inside conf.d, there is a .d folder per check name (for example, http_check.d/), and renaming the conf.yaml.example inside it to conf.yaml enables the check. You can also place multiple YAML files in the same folder to split the configuration. Files ending in .default are the always-on basic checks such as CPU / memory / uptime; they are ignored if other configuration exists, and you delete the file to stop them. Autodiscovery templates are auto_conf.yaml in the same folder. Zero-length files are ignored, so placing an empty template output does no harm.
The 5 keys you touch first
There are 5 keys you touch first. api_key is the key used to authenticate data submission, and in the example configuration it is marked required, alongside the nested item network_address. site is the destination Datadog site; the default is datadoghq.com, and to send to the EU you change it to something like datadoghq.eu. hostname is an optional item that overrides the automatically detected hostname, and its default is empty. tags is the list of host tags attached to all data this Agent emits. logs_enabled enables log collection, and its default is false (as of September 2026; Source: the example configuration bundled with the Agent, datadog-agent_linux.yaml.example). In the example configuration, everything except api_key is commented out; you remove the leading # and fill in the value. Deeper dives are left to the entries on API Key, Datadog Site, and Tag.
Restart after editing, and environment variables win
Changes to the file are loaded by restarting the Agent. The restart procedure differs per OS, and the list of commands is covered in the Datadog Agent explainer. In container environments the standard practice is to pass settings as environment variables instead of editing the file, using the key name in uppercase with DD_ prefixed (DD_HOSTNAME for hostname). When the same item exists in both the file and an environment variable, the environment variable takes precedence. If you specify a nested item with an environment variable, all items beneath it are replaced by the environment variable side (proxy is the only exception). Not every item can be specified by environment variable; unsupported items are marked no-env in the schema (as of September 2026; Source: Agent Environment Variables). This precedence is the place to look when you have fixed the file but the value does not change.
When the Agent is running but no data arrives
The typical time you care about datadog.yaml is when the Agent process is running but data is not reaching Datadog. The first place to check is this file and the environment variables that override it.
- Is
api_keythe key for the correct organization? For key status, see the API Key entry - Does
sitematch the Datadog site you are logged in to? A mismatch shows up as "no data arriving" - Are the environment variables
DD_API_KEY/DD_SITEoverriding the values in the file? - Did you restart the Agent after editing?
- Have you written monitoring target settings into
datadog.yamlinstead ofconf.d?
Alongside hand-editing, there is also a path for changing settings remotely from the interface. Its scope and conditions are covered in the Remote Configuration entry, and not every item in datadog.yaml can be changed from the interface. Knowing the file's location and the precedence rules lets you work out through which path a value was changed.