datadog-mcp 2.0.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,6 +23,12 @@ DD_APP_KEY=your-app-key
23
23
 
24
24
  ```bash
25
25
  DD_SITE=datadoghq.com # Default. Use datadoghq.eu for EU, etc.
26
+
27
+ # Limit defaults (fallbacks when AI doesn't specify)
28
+ MCP_DEFAULT_LIMIT=50 # General tools default limit
29
+ MCP_DEFAULT_LOG_LINES=200 # Logs tool default limit
30
+ MCP_DEFAULT_METRIC_POINTS=1000 # Metrics timeseries data points
31
+ MCP_DEFAULT_TIME_RANGE=24 # Default time range in hours
26
32
  ```
27
33
 
28
34
  ### Optional Flags
@@ -205,6 +211,18 @@ When running with `--transport=http`:
205
211
 
206
212
  ## Token Efficiency
207
213
 
214
+ ### Limit Control
215
+
216
+ AI assistants have full control over query limits. The environment variables set what value is used when the AI doesn't specify a limit. They do NOT cap what the AI can request.
217
+
218
+ | Tool | Default | Parameter | Description |
219
+ |------|---------|-----------|-------------|
220
+ | Logs | 200 | `limit` | Log lines to return |
221
+ | Metrics (timeseries) | 1000 | `pointLimit` | Data points per series (controls resolution) |
222
+ | General tools | 50 | `limit` | Results to return |
223
+
224
+ Defaults can be configured via `MCP_DEFAULT_*` environment variables.
225
+
208
226
  ### Compact Mode (Logs)
209
227
 
210
228
  Use `compact: true` when searching logs to reduce token usage. Strips custom attributes and keeps only essential fields:
@@ -234,23 +252,57 @@ The `diverse` mode normalizes messages (strips UUIDs, timestamps, IPs, numbers)
234
252
 
235
253
  ## Events Aggregation
236
254
 
237
- Find the noisiest monitors with a single query:
255
+ ### Top Monitors Report (Best for Weekly/Daily Meteo)
256
+
257
+ Get top alerting monitors with automatic context breakdown by queue, service, ingress, pod, etc:
238
258
 
239
259
  ```
240
260
  events({ action: "top", from: "7d", limit: 10 })
241
261
  ```
242
262
 
243
- Returns:
263
+ Returns nested structure perfect for reports:
244
264
  ```json
245
265
  {
246
266
  "top": [
247
- { "rank": 1, "name": "Error budget (SLI)", "alertCount": 44, "lastAlert": "..." },
248
- { "rank": 2, "name": "High number of ready messages", "alertCount": 38, "lastAlert": "..." }
267
+ {
268
+ "rank": 1,
269
+ "name": "High number of ready messages",
270
+ "monitor_id": 67860480,
271
+ "total_count": 50,
272
+ "by_context": [
273
+ {"context": "queue:state-status_tasks", "count": 30},
274
+ {"context": "queue:updated_order_service", "count": 20}
275
+ ]
276
+ },
277
+ {
278
+ "rank": 2,
279
+ "name": "Nginx 5XX errors",
280
+ "monitor_id": 134611486,
281
+ "total_count": 42,
282
+ "by_context": [
283
+ {"context": "ingress:trusk-api", "count": 29},
284
+ {"context": "ingress:backoffice", "count": 13}
285
+ ]
286
+ }
249
287
  ]
250
288
  }
251
289
  ```
252
290
 
253
- For more control, use `aggregate` with custom groupBy:
291
+ Context tags are auto-extracted: `queue:`, `service:`, `ingress:`, `pod_name:`, `kube_namespace:`, `kube_container_name:`
292
+
293
+ ### Tag Discovery
294
+
295
+ Discover available tag prefixes in your alert data:
296
+
297
+ ```
298
+ events({ action: "discover", from: "7d", tags: ["source:alert"] })
299
+ ```
300
+
301
+ Returns: `{tagPrefixes: ["queue", "service", "ingress", "pod_name", "monitor", "priority"], sampleSize: 150}`
302
+
303
+ ### Custom Aggregation
304
+
305
+ For custom grouping patterns, use `aggregate`:
254
306
 
255
307
  ```
256
308
  events({
@@ -261,7 +313,7 @@ events({
261
313
  })
262
314
  ```
263
315
 
264
- Supported groupBy fields: `monitor_name`, `priority`, `alert_type`, `source`, `status`, `host`
316
+ Supported groupBy fields: `monitor_name`, `priority`, `alert_type`, `source`, `status`, `host`, or any tag prefix
265
317
 
266
318
  The aggregation uses v2 API with cursor pagination to stream through events efficiently (up to 10k events).
267
319