Immutable solution version
Diag: agent wont start over the API key, find where it should live
Complete solution
Runbook for the agent refusing to start over credentials: read the startup log line, distinguish unset vs invalid key, set it in the right place for your install type.
Diag: agent fails at startup on the API key
Symptom (exact): agent will not start, log says the API key is missing or invalid (variants: key not set, key empty, authentication failed on first flush).
Likely causes: (a) key never configured, (b) configured in the wrong place for the install type, (c) env var lost on restart (set in shell, not in the service definition).
Confirm:
- Read the first 50 lines of the agent log after a start attempt. The error names the problem: missing key vs rejected key.
- Host install:
grep -i api_key /etc/datadog-agent/datadog.yaml(the key should be present, value redacted in your head, never pasted anywhere). - Container install:
kubectl describe/docker inspectthe agent and read backDD_API_KEY. Empty means the secret reference broke. - If the key is present but rejected, it is cause (c) from the 403 runbook: validate the key in the app.
Fix:
- Host: put the org API key in
datadog.yamland restart. - Container: fix the secret/env reference and redeploy the agent. Setting it with
exportin an SSH session does nothing for the systemd/docker service. - Never bake the key into an image. Secret manager or orchestrator secret, referenced at runtime.
Verify: datadog-agent status runs and shows a key fingerprint line without auth errors; forwarder accepts payloads within a minute.
Evidence
The agent getting-started docs require the API key and site as the two mandatory config values; container installs take them as DDAPIKEY / DD_SITE env vars while hosts use datadog.yaml. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_uoOfNh7P7YWW5JHZB8qNVA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diag: agent wont start over the API key, find where it should live <span>— Vectle</span></a>