Skip to content

Comments

feat(alerts): add scheduleStartAt + scheduleOffsetMinutes#1745

Open
mlsalcedo wants to merge 27 commits intohyperdxio:mainfrom
mlsalcedo:startTime-offset
Open

feat(alerts): add scheduleStartAt + scheduleOffsetMinutes#1745
mlsalcedo wants to merge 27 commits intohyperdxio:mainfrom
mlsalcedo:startTime-offset

Conversation

@mlsalcedo
Copy link

@mlsalcedo mlsalcedo commented Feb 17, 2026

Closes #1715

Summary

  • Add scheduleStartAt and scheduleOffsetMinutes to alert schemas and API validation.
  • Update alert evaluation scheduling to anchor windows by scheduleStartAt when set.
  • Skip evaluations before scheduleStartAt.
  • Keep current behavior unchanged when scheduling fields are unset.
  • Add UI fields and API/OpenAPI/external API support for the new schedule options.
  • Add alert scheduler tests for anchored windows and pre-start skip behavior.

Notes

  • This enables Splunk-style scheduled monitor migration where checks must run on isolated, periodic windows anchored to specific times.
  • scheduleStartAt is the primary anchor; scheduleOffsetMinutes remains optional for backward-compatible alignment.

@vercel
Copy link

vercel bot commented Feb 17, 2026

@melsalcedo is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: 2d29bb5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@hyperdx/api Minor
@hyperdx/app Minor
@hyperdx/common-utils Minor
@hyperdx/otel-collector Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@sgarfinkel sgarfinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some feedback

mlsalcedo and others added 4 commits February 17, 2026 10:36
Co-authored-by: Sam Garfinkel <10210461+sgarfinkel@users.noreply.github.com>
Co-authored-by: Sam Garfinkel <10210461+sgarfinkel@users.noreply.github.com>
@teeohhem teeohhem self-requested a review February 19, 2026 18:09
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

PR Review: feat(alerts): add scheduleStartAt + scheduleOffsetMinutes

No critical issues found. Implementation is well-structured with solid test coverage.

A few items worth noting:

  • WARNING: validateAlertScheduleOffsetMinutes skips offset validation when scheduleStartAt is set — The check scheduleOffsetMinutes >= intervalMinutes still runs even when scheduleStartAt is provided (though it correctly does nothing at that point since offset is forced to 0). Not a bug, just a minor clarity issue.

  • WARNING: Date range limits use approximate year lengths (365 * 24 * 60 * 60 * 1000) — won't account for leap years. Negligible in practice but worth noting.

  • INFO: Redundant max(1439) on base Zod schema in zod.ts and types.ts — the superRefine already enforces the dynamic per-interval max. Not harmful, just redundant.

  • INFO: makeAlert calls new Date(alert.scheduleStartAt) without error handling — safe because alertSchema.parse() is now called before makeAlert in all routers, ensuring scheduleStartAt is a valid ISO string. The recent change to explicitly parse in routers (previously req.body was used directly) is a good fix.

The backward-compat strategy via normalizeNoOpAlertScheduleFields and the null-vs-undefined distinction for scheduleStartAt serialization are well thought out.

Reviewed by Claude Sonnet 4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Alert Scheduling with Absolute Start Time (plus optional offset)

4 participants