datadog-logs
Query and filter Datadog logs from the shell using the Composio CLI. Run scoped log searches, pivot across services/environments, and export structured JSON for downstream agents instead of click-driving the Datadog UI.
Install
npx skills add https://github.com/composio-community/awesome-codex-skills --skill datadog-logsSKILL.md
Datadog Logs
Query Datadog logs through the Composio CLI so the agent can filter, pivot, and summarize without you pasting screenshots.
When to Use
- Investigating a spike, error surge, or latency regression and you want structured JSON back.
- Correlating a deploy with log volume changes across services/environments.
- Building a scheduled "what broke overnight" digest.
Prereqs
curl -fsSL https://composio.dev/install | bash
composio login
composio link datadog # prompts for site + API/APP keys
Discover Tools
composio search "search logs" --toolkits datadog
composio search "aggregate logs" --toolkits datadog
composio tools list datadog
Commonly used slugs (confirm with --get-schema):
DATADOG_SEARCH_LOGSDATADOG_AGGREGATE_LOGSDATADOG_LIST_ACTIVE_METRICSDATADOG_GET_EVENT
Filter Recipes
Errors from one service in the last 15 minutes
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": {
"query": "service:checkout status:error env:prod",
"from": "now-15m",
"to": "now"
},
"page": { "limit": 100 },
"sort": "-timestamp"
}'
Aggregate error count by endpoint
composio execute DATADOG_AGGREGATE_LOGS -d '{
"filter": { "query": "service:checkout status:error", "from": "now-1h", "to": "now" },
"group_by": [{ "facet": "@http.url_path", "limit": 20 }],
"compute": [{ "aggregation": "count" }]
}'
Trace a single request across services
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": { "query": "@trace_id:7f3a2b1c env:prod", "from": "now-1h", "to": "now" },
"sort": "timestamp"
}'
Save a reusable query
composio search "save log view" --toolkits datadog
composio execute DATADOG_CREATE_SAVED_VIEW -d '{
"name": "checkout-errors-prod",
"query": "service:checkout status:error env:prod"
}'
Pipe into Local Analysis
Datadog output is JSON on stdout — pipe to jq for quick summaries:
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": {"query":"service:api status:error","from":"now-30m","to":"now"},
"page":{"limit":500}
}' | jq -r '.data[].attributes.message' | sort | uniq -c | sort -rn | head
Multi-Step Workflow
Save as scripts/dd-incident.ts, then composio run --file scripts/dd-incident.ts -- --service checkout:
const svc = process.argv[process.argv.indexOf("--service") + 1];
const errors = await execute("DATADOG_SEARCH_LOGS", {
filter: { query: `service:${svc} status:error`, from: "now-1h", to: "now" },
page: { limit: 200 }, sort: "-timestamp"
});
const topPaths = await execute("DATADOG_AGGREGATE_LOGS", {
filter: { query: `service:${svc} status:error`, from: "now-1h", to: "now" },
group_by: [{ facet: "@http.url_path", limit: 10 }],
compute: [{ aggregation: "count" }]
});
console.log(JSON.stringify({ svc, sample: errors.data?.slice(0,5), topPaths }, null, 2));
Schedule a Daily Digest
Use cron (or composio dev listen for triggers) to run the workflow and forward results to Slack:
composio run --file scripts/dd-incident.ts -- --service checkout \
| tee /tmp/digest.json
composio execute SLACK_SEND_MESSAGE -d "$(jq -n \
--slurpfile d /tmp/digest.json \
'{channel:"oncall", text: ($d[0] | tojson)}')"
Troubleshooting
- Empty results → confirm
env:andservice:tags; Datadog indexes are region-scoped — set the right site duringcomposio link datadog. 403 Forbidden→ the APP key lackslogs_read; regenerate with scope and re-link.- Slow queries → narrow
from/to, add afacetfilter, or useDATADOG_AGGREGATE_LOGSinstead of pulling raw events. - Unknown facet →
composio search "list log facets" --toolkits datadog.
Full CLI reference: docs.composio.dev/docs/cli
Related skills
azure-diagnosticsmicrosoft608KDebug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, troubleshoot functions, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, aazure-preparemicrosoft608KPrepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azazure-aimicrosoft608KUse for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.azure-deploymicrosoft607KExecute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: \"run azd up\", \"run azd deploy\", \"execute deployment\",