datadog-agent
Skill4 starsChanged 6 months agoMITView on GitHub
Use when installing, configuring, or updating Datadog Agent;
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- gh-modelsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When configuring, installing, or troubleshooting the Datadog Agent on a Linux host.
- Very specific: line 17
When updating Ansible playbooks that deploy the datadog.dd.agent role.
- Very specific: line 22
When managing Datadog SaaS configurations like Monitors or SLOs (use datadog-monitors).
- Distinctive: line 23
If you are deploying Datadog strictly via a Helm chart in Kubernetes without needing custom host-level Python checks.
- Very specific: line 33
Agent Immutability: Prefer immutable configuration deployments (e.g., Ansible) over manual modifications to datadog.yaml or conf.d/.
- Very specific: line 34
API Key Handling: Never hardcode datadog_api_key in playbooks.
- Very specific: line 40
When using the datadog.dd.agent (or legacy datadog.datadog) Ansible role, ensure correct YAML hierarchy, especially for log collection.
- Very specific: line 43
Avoid Array Root: Do not map a check directly to an array.
- Very specific: line 59
Create custom Python checks by extending AgentCheck for simple metrics or OpenMetricsBaseCheckV2 for Prometheus endpoints.
- Very specific: line 110
Check agent status: datadog-agent status
- Very specific: line 111
Subprocess execution: Never use Python's native subprocess module due to the Agent's Go-runtime multithreading constraints.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: datadog-agent
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->Expert-level guidance for installing, configuring, and extending the Datadog Agent, including Ansible orchestration and custom OpenMetrics checks.
When to Use
- When configuring, installing, or troubleshooting the Datadog Agent on a Linux host.
- To write custom Python check scripts (
AgentCheckorOpenMetricsBaseCheckV2) for the agent. - When updating Ansible playbooks that deploy the
datadog.dd.agentrole.
When Not to Use
- For querying Datadog APIs to read telemetry or dashboard data (use
datadog-apiinstead). - When managing Datadog SaaS configurations like Monitors or SLOs (use
datadog-monitors). - If you are deploying Datadog strictly via a Helm chart in Kubernetes without needing custom host-level Python checks.
Common Pitfalls
- Subprocess Hangs: Using Python's native
subprocessmodule inside a custom check instead ofget_subprocess_output(), which deadlocks the Agent's Go-runtime. - Misnamed Files: Creating a custom check script named
my_check.pybut naming the configuration filecustom_check.yaml, causing the Agent to silently ignore it. - Root Level Logs: Defining
- type: fileat the root of a check's YAML configuration instead of properly nesting it under alogs:key.
Core Principles
- Agent Immutability: Prefer immutable configuration deployments (e.g., Ansible) over manual modifications to
datadog.yamlorconf.d/. - API Key Handling: Never hardcode
datadog_api_keyin playbooks; utilize vault secrets or environment variables. - Python Compatibility: Custom Agent checks must be Python 3 compatible for modern Agent versions (v7+).
- File Matching: The custom check script name (e.g.,
my_check.py) must exactly match its configuration file name (e.g.,my_check.yaml).
Ansible Integration & Logs Configuration
When using the datadog.dd.agent (or legacy datadog.datadog) Ansible role, ensure correct YAML hierarchy, especially for log collection.
- Requirements: Ansible v2.10+,
ansible-galaxy collection install datadog.dd - Avoid Array Root: Do not map a check directly to an array. A common mistake with logs is defining
- type: fileat the root check level. - Correct Logs Structure: Logs must be encapsulated under a
logs:key within the specific check dictionary.
# Correct Ansible definition for logs attached to a custom/syslog check
datadog_checks:
syslog: # Creates /etc/datadog-agent/conf.d/syslog.d/conf.yaml
logs:
- type: file
path: /var/log/syslog
service: syslog
source: syslogCustom Agent Checks
Create custom Python checks by extending AgentCheck for simple metrics or OpenMetricsBaseCheckV2 for Prometheus endpoints.
- Directory Paths:
- Scripts:
/etc/datadog-agent/checks.d/ - Configs:
/etc/datadog-agent/conf.d/<CHECK_NAME>.d/conf.yaml
- Scripts:
- Naming Convention: Prefix custom checks with
custom_(e.g.,custom_postfix.py) to avoid conflicts with out-of-the-box integrations. - Check Verification:
sudo -u dd-agent -- datadog-agent check <CHECK_NAME>
Simple Python Check
from datadog_checks.base import AgentCheck
class CustomCheck(AgentCheck):
def check(self, instance):
self.gauge('custom.metric', 1, tags=instance.get('tags', []))OpenMetrics Base Check (V2)
Advanced scraping from Prometheus endpoints. Requires openmetrics_endpoint in the check config.
from datadog_checks.base import OpenMetricsBaseCheckV2, ConfigurationError
class CustomOpenMetricsCheck(OpenMetricsBaseCheckV2):
__NAMESPACE__ = "my_namespace"
def __init__(self, name, init_config, instances):
super(CustomOpenMetricsCheck, self).__init__(name, init_config, instances)
self.metrics_map = {
'prom_metric_name': 'datadog.metric.name',
}
def get_default_config(self):
return {'metrics': self.metrics_map}
def check(self, instance):
endpoint = instance.get('openmetrics_endpoint')
if not endpoint:
raise ConfigurationError("Missing 'openmetrics_endpoint'")
super().check(instance)Integrations & Developer Platform
- Tiles & Dashboards: Official integrations must include out-of-the-box dashboards and telemetry logic. API integrations require OAuth 2.0.
- Platform Separation: Agent-based integrations collect from local hosts, whereas API-based integrations ingest directly via Datadog REST endpoints.
Diagnostics and Troubleshooting
- Check agent status:
datadog-agent status - Subprocess execution: Never use Python's native
subprocessmodule due to the Agent's Go-runtime multithreading constraints. Always useget_subprocess_output()fromdatadog_checks.base.utils.subprocess_output.
from datadog_checks.base.utils.subprocess_output import get_subprocess_output
out, err, retcode = get_subprocess_output(["ls", "."], self.log, raise_on_empty_output=True)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

