datadog-cli
This CLI tool allows agents to search logs, stream events, query metrics, and manage dashboards for incident triage.
Install
mkdir -p .claude/skills/datadog-cli && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5199" && unzip -o skill.zip -d .claude/skills/datadog-cli && rm skill.zipInstalls to .claude/skills/datadog-cli
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Datadog CLI for searching logs, querying metrics, tracing requests, and managing dashboards. Use this when debugging production issues or working with Datadog observability.Key capabilities
- →Search and filter logs
- →Stream real-time logs
- →Query timeseries metrics
- →Trace distributed requests
- →Manage dashboard lifecycles
How it works
The CLI interacts with Datadog APIs to execute queries, stream events, and perform CRUD operations on dashboards based on user-provided flags.
Inputs & outputs
When to use datadog-cli
- →Search and filter error logs by service
- →Query timeseries metrics for performance analysis
- →Stream logs in real-time for live debugging
- →Manage and update dashboard lists
About this skill
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:
Setup
Environment Variables (Required)
export DD_API_KEY="your-api-key"
export DD_APP_KEY="your-app-key"
Get keys from: https://app.datadoghq.com/organization-settings/api-keys
Running the CLI
npx @leoflores/datadog-cli <command>
For non-US Datadog sites, use --site flag:
npx @leoflores/datadog-cli logs search --query "*" --site datadoghq.eu
Commands Overview
| Command | Description |
|---|---|
logs search | Search logs with filters |
logs tail | Stream logs in real-time |
logs trace | Find logs for a distributed trace |
logs context | Get logs before/after a timestamp |
logs patterns | Group similar log messages |
logs compare | Compare log counts between periods |
logs multi | Run multiple queries in parallel |
logs agg | Aggregate logs by facet |
metrics query | Query timeseries metrics |
errors | Quick error summary by service/type |
services | List services with log activity |
dashboards | Manage dashboards (CRUD) |
dashboard-lists | Manage dashboard lists |
Quick Examples
Search Errors
npx @leoflores/datadog-cli logs search --query "status:error" --from 1h --pretty
Tail Logs (Real-time)
npx @leoflores/datadog-cli logs tail --query "service:api status:error" --pretty
Error Summary
npx @leoflores/datadog-cli errors --from 1h --pretty
Trace Correlation
npx @leoflores/datadog-cli logs trace --id "abc123def456" --pretty
Query Metrics
npx @leoflores/datadog-cli metrics query --query "avg:system.cpu.user{*}" --from 1h --pretty
Compare Periods
npx @leoflores/datadog-cli logs compare --query "status:error" --period 1h --pretty
Global Flags
| Flag | Description |
|---|---|
--pretty | Human-readable output with colors |
--output <file> | Export results to JSON file |
--site <site> | Datadog site (e.g., datadoghq.eu) |
Time Formats
- Relative:
30m,1h,6h,24h,7d - ISO 8601:
2024-01-15T10:30:00Z
Incident Triage Workflow
# 1. Quick error overview
npx @leoflores/datadog-cli errors --from 1h --pretty
# 2. Is this new? Compare to previous period
npx @leoflores/datadog-cli logs compare --query "status:error" --period 1h --pretty
# 3. Find error patterns
npx @leoflores/datadog-cli logs patterns --query "status:error" --from 1h --pretty
# 4. Narrow down by service
npx @leoflores/datadog-cli logs search --query "status:error service:api" --from 1h --pretty
# 5. Get context around a timestamp
npx @leoflores/datadog-cli logs context --timestamp "2024-01-15T10:30:00Z" --service api --pretty
# 6. Follow the distributed trace
npx @leoflores/datadog-cli logs trace --id "TRACE_ID" --pretty
See workflows.md for more debugging workflows.
When not to use it
- →When performing complex dashboard design not supported by CLI
Prerequisites
Limitations
- →Requires valid API and APP keys
- →Limited by Datadog API rate limits
How it compares
It allows for programmatic log and metric triage directly from the terminal, bypassing the web UI for common debugging tasks.
Compared to similar skills
datadog-cli side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| datadog-cli (this skill) | 1 | 6mo | Review | Intermediate |
| gcloud-usage | 1 | 7mo | No flags | Intermediate |
| devops-troubleshooter | 1 | 4mo | No flags | Advanced |
| autotel | 0 | 1mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by davila7
View all by davila7 →You might also like
gcloud-usage
fcakyon
This skill should be used when user asks about "GCloud logs", "Cloud Logging queries", "Google Cloud metrics", "GCP observability", "trace analysis", or "debugging production issues on GCP".
devops-troubleshooter
sickn33
Expert DevOps troubleshooter specializing in rapid incident response, advanced debugging, and modern observability. Masters log analysis, distributed tracing, Kubernetes debugging, performance optimization, and root cause analysis. Handles production outages, system reliability, and preventive monitoring. Use PROACTIVELY for debugging, incident response, or system troubleshooting.
autotel
jagreehal
Use when instrumenting with trace/span/track, reviewing code for logging and observability patterns, converting console.log to wide events, adding structured errors, setting up canonical log lines, configuring init(), adding subscribers, or working in the autotel monorepo.
ai-debug-harness
DeandreFu
Self-driving Electron + Node debug harness with NDJSON logs, Playwright E2E, doctor preflight, and a YAML-frontmatter cookbook of known causes. Use when a voice-chat E2E flow misbehaves locally, audio publish silently fails, the agent worker emits warnings, or any LiveKit/Electron/Fastify error appe
analyze-prod-issue
MaxPayne89
>-
service-mesh-observability
wshobson
Implement comprehensive observability for service meshes including distributed tracing, metrics, and visualization. Use when setting up mesh monitoring, debugging latency issues, or implementing SLOs for service communication.