Catalog
softaworks/datadog-cli

softaworks

datadog-cli

Datadog CLI for searching logs, querying metrics, tracing requests, and managing dashboards. Use this when debugging production issues or working with Datadog observability.

global
0installs0uses~868
v1.1Saved Apr 20, 2026

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.

Files7
7 files · 18.4 KB

Select a file to preview

Overall Score

84/100

Grade

B

Good

Safety

82

Quality

87

Clarity

88

Completeness

80

Summary

A CLI skill for agents to query Datadog logs, metrics, and dashboards for observability and incident triage. The skill provides structured commands for searching logs, streaming real-time data, tracing requests across services, and managing dashboards—designed to help agents debug production issues autonomously.

Detected Capabilities

Log search and filtering with Datadog query syntaxReal-time log streaming (tail)Distributed trace correlation and log context retrievalError pattern detection and aggregationMetrics querying with time-series dataDashboard CRUD operations (create, read, update, delete)Multi-query parallel executionOutput export to JSON filesSupport for multiple Datadog sites (US, EU, etc.)

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

search datadog logsdebug production errorincident triagequery datadog metricstrace request idtail logs real-timedatadog dashboarderror pattern analysis

Risk Signals

WARNING

Plaintext API and app key environment variables (DD_API_KEY, DD_APP_KEY)

SKILL.md Setup section, references/dashboards.md
WARNING

Destructive dashboard update operation with data loss risk if fields omitted

references/dashboards.md: 'Dashboard Update is DESTRUCTIVE' section
INFO

Outbound network requests to Datadog API endpoints (app.datadoghq.com, datadoghq.eu)

SKILL.md, referenced domains
INFO

File writes to project directories with --output flag (e.g., errors.json, cpu-metrics.json)

references/workflows.md: 'Export for Sharing' section
INFO

Shell variable handling with jq for JSON manipulation in dashboard workflows

references/dashboards.md: 'Safe Dashboard Update Workflow' steps 2-3

Referenced Domains

External domains referenced in skill content, detected by static analysis.

app.datadoghq.comgithub.comwww.datadoghq.com

Use Cases

  • Search and filter production logs by service, status, or error type
  • Stream real-time logs to monitor ongoing issues or deployments
  • Correlate logs across distributed services using trace IDs
  • Identify error patterns and compare current errors to historical baselines
  • Query system and application metrics (CPU, memory, response times)
  • Triage production incidents using structured multi-step workflows
  • Export observability data for reports or sharing with teams

Quality Notes

  • Excellent structure with clear command reference tables and practical examples throughout
  • Comprehensive documentation: 5 reference files cover logs, metrics, query syntax, dashboards, and workflows
  • Strong incident triage workflow provided with step-by-step examples and real-world scenarios
  • Critical safety guidance for destructive dashboard updates includes both warnings and detailed recovery procedures
  • Well-documented edge case handling (file output vs. shell variables for JSON parsing to avoid encoding issues)
  • Time format support is clearly documented (relative and absolute ISO 8601)
  • Global flags (--pretty, --output, --site) well-explained for flexibility
  • References section enforces prerequisite reading before command usage
  • Multi-step dashboard workflows include backup and verification steps to prevent data loss
  • Real-time monitoring workflows (tail) clearly documented with keyboard shortcuts
  • One minor weakness: no explicit error handling guidance for failed API calls or network timeouts
Model: claude-haiku-4-5-20251001Analyzed: Apr 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

v1.1

Content updated

2026-04-20

Latest
v1.0

No changelog

2026-04-12

Add softaworks/datadog-cli to your library

Command Palette

Search for a command to run...