datadog-mcp 1.0.10 → 1.0.11

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/dist/index.js CHANGED
@@ -384,7 +384,9 @@ var InputSchema = {
384
384
  query: z2.string().optional().describe("Search query (for search action)"),
385
385
  name: z2.string().optional().describe("Filter by name (for list action)"),
386
386
  tags: z2.array(z2.string()).optional().describe("Filter by tags"),
387
- groupStates: z2.array(z2.string()).optional().describe("Filter by group states: alert, warn, no data, ok"),
387
+ groupStates: z2.array(z2.string()).optional().describe(
388
+ "Filter multi-alert monitors by group states (e.g., alert by host). Does NOT filter by overall monitor status. Values: alert, warn, no data, ok"
389
+ ),
388
390
  limit: z2.number().optional().describe("Maximum number of monitors to return"),
389
391
  config: z2.record(z2.unknown()).optional().describe("Monitor configuration (for create/update)"),
390
392
  message: z2.string().optional().describe("Mute message (for mute action)"),
@@ -1395,6 +1397,8 @@ function formatSpan(span) {
1395
1397
  const tags = attrs.tags ?? [];
1396
1398
  const nestedAttrs = attrs.attributes ?? {};
1397
1399
  const custom = attrs.custom ?? {};
1400
+ const attrsError = attrs.error ?? {};
1401
+ const customError = custom.error ?? {};
1398
1402
  const tagMap = {};
1399
1403
  for (const tag of tags) {
1400
1404
  const [key, value] = tag.split(":");
@@ -1410,13 +1414,13 @@ function formatSpan(span) {
1410
1414
  } else if (typeof custom["duration"] === "number") {
1411
1415
  durationNs = custom["duration"];
1412
1416
  }
1413
- const status = nestedAttrs["status"] ?? custom["status"] ?? tagMap["status"] ?? "";
1417
+ const status = attrs.status ?? custom["status"] ?? tagMap["status"] ?? "";
1414
1418
  return {
1415
1419
  traceId: attrs.traceId ?? "",
1416
1420
  spanId: attrs.spanId ?? "",
1417
1421
  service: attrs.service ?? "",
1418
1422
  resource: attrs.resourceName ?? "",
1419
- operation: nestedAttrs["operation_name"] ?? custom["operation_name"] ?? "",
1423
+ operation: attrs.operationName ?? custom["operation_name"] ?? "",
1420
1424
  type: attrs.type ?? "",
1421
1425
  status,
1422
1426
  duration: formatDurationNs(durationNs),
@@ -1427,8 +1431,8 @@ function formatSpan(span) {
1427
1431
  url: tagMap["http.url"] ?? ""
1428
1432
  },
1429
1433
  error: {
1430
- type: tagMap["error.type"] ?? "",
1431
- message: tagMap["error.message"] ?? tagMap["error.msg"] ?? ""
1434
+ type: attrsError["type"] ?? customError["type"] ?? tagMap["error.type"] ?? "",
1435
+ message: customError["message"] ?? tagMap["error.message"] ?? tagMap["error.msg"] ?? ""
1432
1436
  },
1433
1437
  env: attrs.env ?? tagMap["env"] ?? "",
1434
1438
  tags
@@ -1626,7 +1630,7 @@ async function listApmServices(api, params, limits) {
1626
1630
  const buckets = response.data ?? [];
1627
1631
  const services = buckets.map((bucket) => ({
1628
1632
  name: bucket.attributes?.by?.["service"] ?? "",
1629
- spanCount: bucket.attributes?.computes?.["c0"] ?? 0
1633
+ spanCount: bucket.attributes?.compute?.["c0"] ?? 0
1630
1634
  })).filter((s) => s.name !== "");
1631
1635
  return {
1632
1636
  services,