Guides an AI agent through using the Datadog CLI to search logs, query metrics, trace requests and manage dashboards.
- What it does
- This skill provides instructions and reference documentation for operating a Datadog command-line tool through npx. It covers log search, tailing, trace correlation, context lookup, pattern grouping, period comparison, aggregation, metric queries, error summaries, service listing and dashboard management. It also documents required environment variables, global flags, time formats and an incident triage workflow.
- When to use it
- Use it when debugging or triaging production issues with Datadog observability data, or when an agent needs to search logs, query metrics or inspect dashboards. It suits incident investigation and operational troubleshooting rather than general coding tasks.
- Requirements
- Requires Node.js with npx to run the Datadog CLI package, network access to Datadog, and the DD_API_KEY and DD_APP_KEY environment variables. Non-US sites need the --site flag. Ships no scripts; it is instructions and reference documents only.
Datadog CLI
A CLI tool for AI agents to debug and triage using Datadog logs and metrics.
Required Reading
You MUST read the relevant reference docs before using any command:
- Log Commands [blocked]
- Metrics [blocked]
- Query Syntax [blocked]
- Workflows [blocked]
- Dashboards [blocked]
Setup
Environment Variables (Required)
Get keys from: https://app.datadoghq.com/organization-settings/api-keys
Running the CLI
For non-US Datadog sites, use --site flag:
Commands Overview
Quick Examples
Search Errors
Tail Logs (Real-time)
Error Summary
Trace Correlation
Query Metrics
Compare Periods
Global Flags
Time Formats
- Relative:
30m, 1h, 6h, 24h, 7d
- ISO 8601:
2024-01-15T10:30:00Z
Incident Triage Workflow
See workflows.md [blocked] for more debugging workflows.