Skip to content

Service-check monitors with empty options.groupby are silently skipped, causing incomplete migrations #597

Description

@DaniloGT

Monitors.pre_resource_action_hook raises SkipResource for any service check monitor that has an empty or missing options.groupby. While this avoids a hard failure on sync, it means these monitors are silently dropped from the destination.

if resource.get("type") == "service check":
groupby = (resource.get("options") or {}).get("groupby", [])
if not groupby:
raise SkipResource(
_id,
self.resource_type,
"Deprecated resource configuration: Custom check monitor requires at least one group-by. "
"Update the source monitor's options.groupby before syncing.",
)

The following service check monitor has no options.groupby, yet it groups by service in the query and syncs successfully once the guard is commented out and the tool is built from source (some fields redacted):

{
  "id": xxx,
  "org_id": xxx,
  "type": "service check",
  "name": "XXX",
  "message": "XXX",
  "query": "\"datadog.agent.up\".over(\"project:XXX\").by(\"service\").last(2).count_by_status()",
  "options": {
    "thresholds": {
      "critical": 1,
      "warning": 1,
      "ok": 1
    },
    "notify_audit": false,
    "notify_no_data": true,
    "no_data_timeframe": 2,
    "renotify_interval": 0,
    "timeout_h": 0,
    "include_tags": false,
    "new_group_delay": 0,
    "silenced": {}
  },
  "multi": true,
  "created_at": 1763400204000,
  "created": "2025-11-17T17:23:24.665593+00:00",
  "modified": "2026-06-12T15:40:55.978811+00:00",
  "deleted": null,
  "priority": 3,
  "restricted_roles": null,
  "draft_status": "published",
  "overall_state_modified": "2025-11-28T18:15:56+00:00",
  "overall_state": "OK",
  "creator": {
    "name": "XXX",
    "email": "XXX",
    "handle": "XXX,
    "id": XX
  },
  "matching_downtimes": []
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions