datadog-automation
通过Rube MCP(Composio)自动化Datadog任务:查询指标、搜索日志、管理监控器/仪表板、创建事件与停机维护。始终优先使用工具搜索当前架构。
Datadog Automation via Rube MCP
Automate Datadog monitoring and observability operations through Composio's Datadog toolkit via Rube MCP.
Prerequisites
RUBE_MANAGE_CONNECTIONS with toolkit datadogRUBE_SEARCH_TOOLS first to get current tool schemasSetup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
RUBE_SEARCH_TOOLS respondsRUBE_MANAGE_CONNECTIONS with toolkit datadogCore Workflows
1. Query and Explore Metrics
When to use: User wants to query metric data or list available metrics
Tool sequence:
DATADOG_LIST_METRICS - List available metric names [Optional]DATADOG_QUERY_METRICS - Query metric time series data [Required]Key parameters:
query: Datadog metric query string (e.g., avg:system.cpu.user{host:web01})from: Start timestamp (Unix epoch seconds)to: End timestamp (Unix epoch seconds)q: Search string for listing metricsPitfalls:
aggregation:metric_name{tag_filters}from and to are Unix epoch timestamps in seconds, not millisecondsavg, sum, min, max, count{host:web01,env:prod}2. Search and Analyze Logs
When to use: User wants to search log entries or list log indexes
Tool sequence:
DATADOG_LIST_LOG_INDEXES - List available log indexes [Optional]DATADOG_SEARCH_LOGS - Search logs with query and filters [Required]Key parameters:
query: Log search query using Datadog log query syntaxfrom: Start time (ISO 8601 or Unix timestamp)to: End time (ISO 8601 or Unix timestamp)sort: Sort order ('asc' or 'desc')limit: Number of log entries to returnPitfalls:
service:web status:error3. Manage Monitors
When to use: User wants to create, update, mute, or inspect monitors
Tool sequence:
DATADOG_LIST_MONITORS - List all monitors with filters [Required]DATADOG_GET_MONITOR - Get specific monitor details [Optional]DATADOG_CREATE_MONITOR - Create a new monitor [Optional]DATADOG_UPDATE_MONITOR - Update monitor configuration [Optional]DATADOG_MUTE_MONITOR - Silence a monitor temporarily [Optional]DATADOG_UNMUTE_MONITOR - Re-enable a muted monitor [Optional]Key parameters:
monitor_id: Numeric monitor IDname: Monitor display nametype: Monitor type ('metric alert', 'service check', 'log alert', 'query alert', etc.)query: Monitor query defining the alert conditionmessage: Notification message with @mentionstags: Array of tag stringsthresholds: Alert threshold values (critical, warning, ok)Pitfalls:
type must match the query type; mismatches cause creation failuresmessage supports @mentions for notifications (e.g., @slack-channel, @pagerduty)critical at minimum4. Manage Dashboards
When to use: User wants to list, view, update, or delete dashboards
Tool sequence:
DATADOG_LIST_DASHBOARDS - List all dashboards [Required]DATADOG_GET_DASHBOARD - Get full dashboard definition [Optional]DATADOG_UPDATE_DASHBOARD - Update dashboard layout or widgets [Optional]DATADOG_DELETE_DASHBOARD - Remove a dashboard (irreversible) [Optional]Key parameters:
dashboard_id: Dashboard identifier stringtitle: Dashboard titlelayout_type: 'ordered' (grid) or 'free' (freeform positioning)widgets: Array of widget definition objectsdescription: Dashboard descriptionPitfalls:
layout_type cannot be changed after creation; must recreate the dashboard5. Create Events and Manage Downtimes
When to use: User wants to post events or schedule maintenance downtimes
Tool sequence:
DATADOG_LIST_EVENTS - List existing events [Optional]DATADOG_CREATE_EVENT - Post a new event [Required]DATADOG_CREATE_DOWNTIME - Schedule a maintenance downtime [Optional]Key parameters for events:
title: Event titletext: Event body text (supports markdown)alert_type: Event severity ('error', 'warning', 'info', 'success')tags: Array of tag stringsKey parameters for downtimes:
scope: Tag scope for the downtime (e.g., host:web01)start: Start time (Unix epoch)end: End time (Unix epoch; omit for indefinite)message: Downtime descriptionmonitor_id: Specific monitor to downtime (optional, omit for scope-based)Pitfalls:
text supports Datadog's markdown format including @mentionshost:web01, env:stagingend creates an indefinite downtime; always set an end time for maintenancemonitor_id narrows to a single monitor; scope applies to all matching monitors6. Manage Hosts and Traces
When to use: User wants to list infrastructure hosts or inspect distributed traces
Tool sequence:
DATADOG_LIST_HOSTS - List all reporting hosts [Required]DATADOG_GET_TRACE_BY_ID - Get a specific distributed trace [Optional]Key parameters:
filter: Host search filter stringsort_field: Sort hosts by field (e.g., 'name', 'apps', 'cpu')sort_dir: Sort direction ('asc' or 'desc')trace_id: Distributed trace ID for trace lookupPitfalls:
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
key:value format: host:web01, env:prod, service:api{host:web01,env:prod} (AND logic)host:web*Pagination
page and page_size or offset-based pagination depending on endpointKnown Pitfalls
Timestamps:
Query Syntax:
aggregation:metric{tags}field:value pairsRate Limits:
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 |