Loading...
Loading...
Query and analyze Datadog logs, metrics, APM traces, and monitors using the Datadog API. Use when debugging production issues, monitoring application performance, or investigating alerts.
npx skill4agent add openhands/skills datadog[ -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"datadoghq.comdatadoghq.euus3.datadoghq.com-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-H "Content-Type: application/json"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 .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 .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 .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 .