datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

Feature Request: support `customSchedule` (RRULE + timezone) in DatadogMonitor

Open Paul-Weaver opened this issue 9 months ago • 1 comments

🚀 Feature Request: support customSchedule (RRULE + timezone) in DatadogMonitor

Background

  • PR #1702 (merged 26 Mar 2025) added options.schedulingOptions.evaluationWindow — thanks 🎉
    This unblocked cumulative windows (hourStarts, dayStarts, monthStarts).

  • We still cannot express “cron‑style” one‑shot schedules that the Datadog API and Terraform provider expose via:

custom_schedule {
  recurrence {
    rrule    = "FREQ=DAILY;BYHOUR=22;BYMINUTE=30"
    timezone = "Europe/Stockholm"
  }
}

Problem statement

Many existing monitors that people use rely on custom_schedule to fire once at a precise local time. With the Operator we can only approximate this using UTC‑based cumulative windows, which:

  • run continuously instead of once,
  • break on daylight‑saving‑time shifts,
  • cannot model weekly or monthly RRULEs.

Proposal

Add a sibling object to evaluationWindow:

options:
  schedulingOptions:
    customSchedule:               # <— new
      recurrence:
        rrule:    "FREQ=DAILY;BYHOUR=22;BYMINUTE=30"
        timezone: "Europe/Stockholm"

This should map 1‑to‑1 to the Datadog REST field scheduling_options.custom_schedule.

Acceptance criteria

  • [ ] CRD schema updated (v1alpha1 + versioned conversion where needed).
  • [ ] Reconciler sets/patches the monitor with custom_schedule when present.
  • [ ] Unit + e2e tests for daily & weekly RRULEs in different time‑zones.
  • [ ] Documentation & sample manifest.

Environment

value
Operator ver. v0.10.0
K8s v1.29
Datadog region US / EU

Reproduction steps

  1. Apply any manifest containing the customSchedule block above.
  2. Operator rejects it with unknown field validation error.

Additional context

Terraform resource parity: datadog_monitor.scheduling_options.custom_schedule.

Thanks for considering!

Paul-Weaver avatar May 02 '25 17:05 Paul-Weaver

Hi @fanny-jiang, I’ve created a PR to solve this issue, but I don’t have permission to edit labels, which caused the CI jobs to fail.

Could you please add the necessary labels and review at the PR when you have a moment?

rafanaskin avatar Jun 07 '25 13:06 rafanaskin

Completed in https://github.com/DataDog/datadog-operator/pull/1949, will be released in a few weeks with 1.17.0 release

tbavelier avatar Jul 09 '25 09:07 tbavelier