mcpField
D
datadog

datadog

github.com/openhandsCloud & DevOps17593 installsUpdated today
Repository

About datadog

datadog is a skill that guides Datadog API operations through shell commands and request examples. It covers logs, metrics, traces, monitors, and requires checking the relevant environment variables before operations.

Key features

  1. 01Datadog API request examples
  2. 02Log and event searches
  3. 03Metrics queries
  4. 04APM trace searches
  5. 05Monitor listing
  6. 06Windows PowerShell equivalents

Use cases

  1. 01Query Datadog logs for service errors
  2. 02Retrieve metrics for a time range
  3. 03Search APM traces or list monitors

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/openhands/extensions --skill datadog

After installing, type/datadogin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
.plugin/
plugin.json
references/
windows.md

Details

From the project README

Datadog

Windows PowerShell equivalents for the Datadog curl, environment-variable, timestamp, and JSON formatting snippets are in references/windows.md.

Before performing any Datadog operations, first check if the required environment variables are set:
[ -n "$DD_API_KEY" ] && echo "DD_API_KEY is set" || echo "DD_API_KEY is NOT set"
[ -n "$DD_APP_KEY" ] && echo "DD_APP_KEY is set" || echo "DD_APP_KEY is NOT set"
[ -n "$DD_SITE" ] && echo "DD_SITE is set" || echo "DD_SITE is NOT set"

If any of these variables are missing, ask the user to provide them before proceeding:

  • DD_API_KEY: Datadog API key
  • DD_APP_KEY: Datadog Application key
  • DD_SITE: Datadog site (e.g., datadoghq.com, datadoghq.eu, us3.datadoghq.com)

Authentication Headers

-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-H "Content-Type: application/json"

Query Logs

curl -s -X POST "https://api.${DD_SITE}/api/v2/logs/events/search" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "query": "service:my-service status:error",
      "from": "now-1h",
      "to": "now"
    },
    "sort": "-timestamp",
    "page": {"limit": 50}
  }' | jq .

Query Metrics

curl -s -G "https://api.${DD_SITE}/api/v1/query" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
  --data-urlencode "query=avg:system.cpu.user{*}" \
  --data-urlencode "from=$(date -d '1 hour ago' +%s)" \
  --data-urlencode "to=$(date +%s)" | jq .

Query APM Traces

curl -s -X POST "https://api.${DD_SITE}/api/v2/spans/events/search" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "query": "service:my-service",
      "from": "now-1h",
      "to": "now"
    },
    "sort": "-timestamp",
    "page": {"limit": 25}
  }' | jq .

List Monitors

curl -s -G "https://api.${DD_SITE}/api/v1/monitor" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" | jq .

Documentation

Comments

Markdown supported