datadog-automation
Original:🇺🇸 English
Not Translated
Automate Datadog tasks via Rube MCP (Composio): query metrics, search logs, manage monitors/dashboards, create events and downtimes. Always search tools first for current schemas.
2installs
Added on
NPX Install
npx skill4agent add sickn33/antigravity-awesome-skills datadog-automationSKILL.md Content
Datadog Automation via Rube MCP
Automate Datadog monitoring and observability operations through Composio's Datadog toolkit via Rube MCP.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Datadog connection via with toolkit
RUBE_MANAGE_CONNECTIONSdatadog - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
Setup
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSdatadog - If connection is not ACTIVE, follow the returned auth link to complete Datadog authentication
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Query and Explore Metrics
When to use: User wants to query metric data or list available metrics
Tool sequence:
- - List available metric names [Optional]
DATADOG_LIST_METRICS - - Query metric time series data [Required]
DATADOG_QUERY_METRICS
Key parameters:
- : Datadog metric query string (e.g.,
query)avg:system.cpu.user{host:web01} - : Start timestamp (Unix epoch seconds)
from - : End timestamp (Unix epoch seconds)
to - : Search string for listing metrics
q
Pitfalls:
- Query syntax follows Datadog's metric query format:
aggregation:metric_name{tag_filters} - and
fromare Unix epoch timestamps in seconds, not millisecondsto - Valid aggregations: ,
avg,sum,min,maxcount - Tag filters use curly braces:
{host:web01,env:prod} - Time range should not exceed Datadog's retention limits for the metric type
2. Search and Analyze Logs
When to use: User wants to search log entries or list log indexes
Tool sequence:
- - List available log indexes [Optional]
DATADOG_LIST_LOG_INDEXES - - Search logs with query and filters [Required]
DATADOG_SEARCH_LOGS
Key parameters:
- : Log search query using Datadog log query syntax
query - : Start time (ISO 8601 or Unix timestamp)
from - : End time (ISO 8601 or Unix timestamp)
to - : Sort order ('asc' or 'desc')
sort - : Number of log entries to return
limit
Pitfalls:
- Log queries use Datadog's log search syntax:
service:web status:error - Search is limited to retained logs within the configured retention period
- Large result sets require pagination; check for cursor/page tokens
- Log indexes control routing and retention; filter by index if known
3. Manage Monitors
When to use: User wants to create, update, mute, or inspect monitors
Tool sequence:
- - List all monitors with filters [Required]
DATADOG_LIST_MONITORS - - Get specific monitor details [Optional]
DATADOG_GET_MONITOR - - Create a new monitor [Optional]
DATADOG_CREATE_MONITOR - - Update monitor configuration [Optional]
DATADOG_UPDATE_MONITOR - - Silence a monitor temporarily [Optional]
DATADOG_MUTE_MONITOR - - Re-enable a muted monitor [Optional]
DATADOG_UNMUTE_MONITOR
Key parameters:
- : Numeric monitor ID
monitor_id - : Monitor display name
name - : Monitor type ('metric alert', 'service check', 'log alert', 'query alert', etc.)
type - : Monitor query defining the alert condition
query - : Notification message with @mentions
message - : Array of tag strings
tags - : Alert threshold values (
thresholds,critical,warning)ok
Pitfalls:
- Monitor must match the query type; mismatches cause creation failures
type - supports @mentions for notifications (e.g.,
message,@slack-channel)@pagerduty - Thresholds vary by monitor type; metric monitors need at minimum
critical - Muting a monitor suppresses notifications but the monitor still evaluates
- Monitor IDs are numeric integers
4. Manage Dashboards
When to use: User wants to list, view, update, or delete dashboards
Tool sequence:
- - List all dashboards [Required]
DATADOG_LIST_DASHBOARDS - - Get full dashboard definition [Optional]
DATADOG_GET_DASHBOARD - - Update dashboard layout or widgets [Optional]
DATADOG_UPDATE_DASHBOARD - - Remove a dashboard (irreversible) [Optional]
DATADOG_DELETE_DASHBOARD
Key parameters:
- : Dashboard identifier string
dashboard_id - : Dashboard title
title - : 'ordered' (grid) or 'free' (freeform positioning)
layout_type - : Array of widget definition objects
widgets - : Dashboard description
description
Pitfalls:
- Dashboard IDs are alphanumeric strings (e.g., 'abc-def-ghi'), not numeric
- cannot be changed after creation; must recreate the dashboard
layout_type - Widget definitions are complex nested objects; get existing dashboard first to understand structure
- DELETE is permanent; there is no undo
5. Create Events and Manage Downtimes
When to use: User wants to post events or schedule maintenance downtimes
Tool sequence:
- - List existing events [Optional]
DATADOG_LIST_EVENTS - - Post a new event [Required]
DATADOG_CREATE_EVENT - - Schedule a maintenance downtime [Optional]
DATADOG_CREATE_DOWNTIME
Key parameters for events:
- : Event title
title - : Event body text (supports markdown)
text - : Event severity ('error', 'warning', 'info', 'success')
alert_type - : Array of tag strings
tags
Key parameters for downtimes:
- : Tag scope for the downtime (e.g.,
scope)host:web01 - : Start time (Unix epoch)
start - : End time (Unix epoch; omit for indefinite)
end - : Downtime description
message - : Specific monitor to downtime (optional, omit for scope-based)
monitor_id
Pitfalls:
- Event supports Datadog's markdown format including @mentions
text - Downtimes scope uses tag syntax: ,
host:web01env:staging - Omitting creates an indefinite downtime; always set an end time for maintenance
end - Downtime narrows to a single monitor; scope applies to all matching monitors
monitor_id
6. Manage Hosts and Traces
When to use: User wants to list infrastructure hosts or inspect distributed traces
Tool sequence:
- - List all reporting hosts [Required]
DATADOG_LIST_HOSTS - - Get a specific distributed trace [Optional]
DATADOG_GET_TRACE_BY_ID
Key parameters:
- : Host search filter string
filter - : Sort hosts by field (e.g., 'name', 'apps', 'cpu')
sort_field - : Sort direction ('asc' or 'desc')
sort_dir - : Distributed trace ID for trace lookup
trace_id
Pitfalls:
- Host list includes all hosts reporting to Datadog within the retention window
- Trace IDs are long numeric strings; ensure exact match
- Hosts that stop reporting are retained for a configured period before removal
Common Patterns
Monitor Query Syntax
Metric alerts:
avg(last_5m):avg:system.cpu.user{env:prod} > 90Log alerts:
logs("service:web status:error").index("main").rollup("count").last("5m") > 10Tag Filtering
- Tags use format:
key:value,host:web01,env:prodservice:api - Multiple tags: (AND logic)
{host:web01,env:prod} - Wildcard:
host:web*
Pagination
- Use and
pageor offset-based pagination depending on endpointpage_size - Check response for total count to determine if more pages exist
- Continue until all results are retrieved
Known Pitfalls
Timestamps:
- Most endpoints use Unix epoch seconds (not milliseconds)
- Some endpoints accept ISO 8601; check tool schema
- Time ranges should be reasonable (not years of data)
Query Syntax:
- Metric queries:
aggregation:metric{tags} - Log queries: pairs
field:value - Monitor queries vary by type; check Datadog documentation
Rate Limits:
- Datadog API has per-endpoint rate limits
- Implement backoff on 429 responses
- Batch operations where possible
Quick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| Query metrics | DATADOG_QUERY_METRICS | query, from, to |
| List metrics | DATADOG_LIST_METRICS | q |
| Search logs | DATADOG_SEARCH_LOGS | query, from, to, limit |
| List log indexes | DATADOG_LIST_LOG_INDEXES | (none) |
| List monitors | DATADOG_LIST_MONITORS | tags |
| Get monitor | DATADOG_GET_MONITOR | monitor_id |
| Create monitor | DATADOG_CREATE_MONITOR | name, type, query, message |
| Update monitor | DATADOG_UPDATE_MONITOR | monitor_id |
| Mute monitor | DATADOG_MUTE_MONITOR | monitor_id |
| Unmute monitor | DATADOG_UNMUTE_MONITOR | monitor_id |
| List dashboards | DATADOG_LIST_DASHBOARDS | (none) |
| Get dashboard | DATADOG_GET_DASHBOARD | dashboard_id |
| Update dashboard | DATADOG_UPDATE_DASHBOARD | dashboard_id, title, widgets |
| Delete dashboard | DATADOG_DELETE_DASHBOARD | dashboard_id |
| List events | DATADOG_LIST_EVENTS | start, end |
| Create event | DATADOG_CREATE_EVENT | title, text, alert_type |
| Create downtime | DATADOG_CREATE_DOWNTIME | scope, start, end |
| List hosts | DATADOG_LIST_HOSTS | filter, sort_field |
| Get trace | DATADOG_GET_TRACE_BY_ID | trace_id |