Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
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 incident investigation and diagnostics.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Undeveloped: Manual Datadog UI navigation, screenshot pasting, unstructured results.
Target: Composio CLI queries for common patterns, JSON piping for analysis, single-service searches.
Optimized: Multi-step workflows, trace correlation across services, scheduled digests, automated alerting.
Logs are data. Query them programmatically via CLI to get structured JSON, pivot across services/environments, and feed results into downstream analysis or alerts instead of clicking through the UI.
Install Composio CLI:
curl -fsSL https://composio.dev/install | bash
composio login
Link Datadog:
composio link datadog
# Prompts for: Datadog site (e.g., datadoghq.com or datadoghq.eu)
# Prompts for: API Key
# Prompts for: APP Key (must have logs_read scope)
Verify connection:
composio tools list datadog
Search for common actions:
| Action | Purpose | Command |
|---|---|---|
| Search Logs | Filter logs by query | composio search "search logs" --toolkits datadog |
| Aggregate Logs | Group/count logs | composio search "aggregate logs" --toolkits datadog |
| List Metrics | View available metrics | composio search "list.*metrics" --toolkits datadog |
| Get Event | Fetch specific event | composio search "get event" --toolkits datadog |
| Create Saved View | Save query template | composio search "save.*view" --toolkits datadog |
Get schema for any action:
composio tools get-schema DATADOG_SEARCH_LOGS
Common action slugs:
DATADOG_SEARCH_LOGSDATADOG_AGGREGATE_LOGSDATADOG_LIST_ACTIVE_METRICSDATADOG_GET_EVENTFormat: Filter by service, status, environment, time range
Query errors from one service (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"
}'
Query logs from specific trace:
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": {
"query": "@trace_id:7f3a2b1c env:prod",
"from": "now-1h",
"to": "now"
},
"sort": "timestamp"
}'
Query by environment and status:
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": {
"query": "env:staging status:warning",
"from": "now-4h",
"to": "now"
},
"page": { "limit": 200 }
}'
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" }]
}'
Group errors by host/service:
composio execute DATADOG_AGGREGATE_LOGS -d '{
"filter": {
"query": "status:error",
"from": "now-2h",
"to": "now"
},
"group_by": [
{ "facet": "service", "limit": 10 },
{ "facet": "host", "limit": 50 }
],
"compute": [{ "aggregation": "count" }]
}'
Extract and count error messages:
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
Extract trace IDs from errors:
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": { "query": "service:payment status:error", "from": "now-1h", "to": "now" },
"page": { "limit": 100 }
}' | jq -r '.data[].attributes."@trace_id"'
Format for reporting:
composio execute DATADOG_SEARCH_LOGS -d '{
"filter": { "query": "status:error", "from": "now-6h", "to": "now" },
"page": { "limit": 1000 }
}' | jq -r '.data[] | "\(.timestamp) | \(.host) | \(.attributes.message)"'
Save as scripts/incident-check.ts:
const svc = process.argv[process.argv.indexOf("--service") + 1] || "api";
const hours = parseInt(process.argv[process.argv.indexOf("--hours") + 1] || "1");
// Fetch error samples
const errors = await execute("DATADOG_SEARCH_LOGS", {
filter: {
query: `service:${svc} status:error`,
from: `now-${hours}h`,
to: "now"
},
page: { limit: 200 },
sort: "-timestamp"
});
// Aggregate by endpoint
const topPaths = await execute("DATADOG_AGGREGATE_LOGS", {
filter: {
query: `service:${svc} status:error`,
from: `now-${hours}h`,
to: "now"
},
group_by: [{ facet: "@http.url_path", limit: 10 }],
compute: [{ aggregation: "count" }]
});
// Aggregate by host
const topHosts = await execute("DATADOG_AGGREGATE_LOGS", {
filter: {
query: `service:${svc} status:error`,
from: `now-${hours}h`,
to: "now"
},
group_by: [{ facet: "host", limit: 5 }],
compute: [{ aggregation: "count" }]
});
console.log(JSON.stringify({
service: svc,
timespan: `${hours}h`,
error_count: errors.data?.length || 0,
top_errors: errors.data?.slice(0, 5).map(e => e.attributes.message),
error_paths: topPaths.data,
error_hosts: topHosts.data
}, null, 2));
Run the workflow:
composio run --file scripts/incident-check.ts -- --service checkout --hours 2
Create reusable saved query:
composio execute DATADOG_CREATE_SAVED_VIEW -d '{
"name": "checkout-errors-prod",
"description": "Production errors in checkout service",
"query": "service:checkout status:error env:prod"
}'
Schedule daily digest (cron example):
#!/bin/bash
# Add to crontab: 0 9 * * * /path/to/daily-digest.sh
composio run --file scripts/incident-check.ts -- --service checkout --hours 24 > /tmp/digest.json
composio execute SLACK_SEND_MESSAGE -d "$(jq -n \
--slurpfile digest /tmp/digest.json \
'{channel: "oncall", text: "Daily Incident Report: \($digest[0] | tostring)"}')"
| Use Case | Query Example |
|---|---|
| Errors in service | service:api status:error |
| Specific environment | env:prod or env:staging |
| Response time threshold | @duration:[1000 TO *] (>1s) |
| HTTP status codes | @http.status:5xx or @http.status:404 |
| User context | @user.id:12345 |
| Request correlation | @trace_id:abc123def456 |
| Combined filters | service:web env:prod status:error @duration:[1000 TO *] |
| Issue | Solution |
|---|---|
| Empty results | Verify env: and service: tags match your setup; confirm Datadog site region is correct |
| 403 Forbidden | APP Key lacks logs_read scope; regenerate with correct permissions and re-link |
| Slow queries | Narrow from/to window; add additional filters; use AGGREGATE_LOGS instead of SEARCH_LOGS for large datasets |
| Unknown facet | Run composio search "list log facets" --toolkits datadog to discover available facets |
| No logs indexed | Ensure application is instrumented with Datadog agent; check that logs are being sent to Datadog |
Deliver:
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.