Tags that filter which checks are affected by this maintenance window. Checks with ANY of these tags will be paused during the maintenance period to avoid unnecessary alerts.Usage:
Copy
Ask AI
new MaintenanceWindow("my-maintenance", { name: "API Maintenance", tags: ["api", "backend"], /* More options... */})
Maintenance windows affect ALL checks that have ANY of the specified tags. Be specific with your tags to avoid affecting unintended checks.
Use cases: Service targeting, environment isolation, maintenance scope control.
Start date and time for the maintenance window in UTC (ISO 8601 timestamp).Usage:
Copy
Ask AI
new MaintenanceWindow("my-maintenance", { name: "Database Maintenance", startsAt: new Date("2025-02-15T02:00:00.000Z"), // 2 AM UTC /* More options... */})
Use cases: Scheduled downtime, emergency maintenance, recurring maintenance timing.
End date and time for the maintenance window in UTC (ISO 8601 timestamp).Usage:
Copy
Ask AI
new MaintenanceWindow("my-maintenance", { name: "Database Maintenance", startsAt: new Date("2025-02-15T02:00:00.000Z"), endsAt: new Date("2025-02-15T06:00:00.000Z"), // 4-hour window /* More options... */})
Use cases: Maintenance duration control, downtime limitation, schedule coordination.
When to stop repeating the maintenance window (ISO 8601 timestamp in UTC). If not specified, the maintenance window will repeat indefinitely.Usage:
Copy
Ask AI
new MaintenanceWindow("limited-recurring", { name: "Limited Time Maintenance", repeatInterval: 1, repeatUnit: "WEEK", repeatEndsAt: new Date("2025-12-31T23:59:59.000Z"), // Stop at end of year /* More options... */})
Use cases: Limited-time maintenance periods, project-based scheduling, planned end dates.
new MaintenanceWindow("database-maintenance", { name: "Monthly Database Maintenance", tags: ["database", "production"], startsAt: new Date("2025-02-01T02:00:00.000Z"), // First Saturday of month at 2 AM UTC endsAt: new Date("2025-02-01T05:00:00.000Z"), // Ends at 5 AM UTC repeatInterval: 1, repeatUnit: "MONTH", repeatEndsAt: new Date("2025-12-31T23:59:59.000Z"), // Repeat for a year})
Copy
Ask AI
new MaintenanceWindow("system-updates", { name: "Weekly System Updates", tags: ["infrastructure", "updates"], startsAt: new Date("2025-02-02T01:00:00.000Z"), // Every Sunday at 1 AM UTC endsAt: new Date("2025-02-02T02:30:00.000Z"), // 1.5 hour window repeatInterval: 1, repeatUnit: "WEEK", repeatEndsAt: new Date("2025-06-01T00:00:00.000Z"), // Repeat until June})
Copy
Ask AI
// For immediate one-time maintenanceconst now = new Date()const inOneHour = new Date(now.getTime() + 60 * 60 * 1000)const inFourHours = new Date(now.getTime() + 4 * 60 * 60 * 1000)new MaintenanceWindow("emergency-fix", { name: "Emergency Security Patch", tags: ["security", "critical"], startsAt: inOneHour, // Start in 1 hour endsAt: inFourHours, // End in 4 hours (no repeat)})
Copy
Ask AI
// API service maintenancenew MaintenanceWindow("api-maintenance", { name: "API Service Upgrade", tags: ["api", "backend"], startsAt: new Date("2025-02-20T03:00:00.000Z"), endsAt: new Date("2025-02-20T04:00:00.000Z"),})// Frontend deploymentnew MaintenanceWindow("frontend-deployment", { name: "Frontend Deployment", tags: ["frontend", "web"], startsAt: new Date("2025-02-20T04:30:00.000Z"), endsAt: new Date("2025-02-20T05:00:00.000Z"),})// Database migration (longer window)new MaintenanceWindow("database-migration", { name: "Database Schema Migration", tags: ["database", "migration"], startsAt: new Date("2025-02-22T01:00:00.000Z"), endsAt: new Date("2025-02-22T07:00:00.000Z"), // 6-hour window})
Tag Matching: Maintenance windows affect ALL checks that have ANY of the specified tags. Be specific with your tags to avoid affecting unintended checks.
Time Zones: Always use UTC timestamps for consistency across different time zones. Convert your local maintenance times to UTC.