ScheduledDowntime: include/exclude ranges as in TimePeriod
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 616
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
Scheduled downtimes for our applications are to be defined with nightly downtimes for our applications with
offline window to be stored.
Only for the applications with offline window - not for all
service center service time applications, that would be too many.
Thereby the problem arose that it is not possible to integrate any
Timeperiods and no holiday calendar can be integrated into the downtimes,
as it is the case with Notifications Times and Check Periods.
The following did not work and it's really helpfull to have this feature:
apply ScheduledDowntime "MYFANCYDOWNTIME" to Service {
author = "Holy Tux"
comment = "Service center applications with offline window outside of the
the SLA times"
ranges = {
excludes = [ "T-OFF-SERVICECENTER-SERVICETIMES-15M-DELAYED"]
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
assign where ((host.vars.environment == "ENV") &&
match("FANCY_SERVICE-NAME-A*", service.name))
assign where ((host.vars.environment == "ENV") &&
match("FANCY_SERVICE-NAME-B*", service.name))
}
object TimePeriod "T-OFF-SERVICECENTER-SERVICETIMES-15M-DELAYED" {
import "legacy-timeperiod" {
excludes = [ "T-SERVICECENTER-SERVICETIMES-15M-DELAYED" ]
display_name = "Offline time off applications for ServiceCenter
working hours with 15m delayed start"
ranges = {
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
Error message:
[YYYY-MM-DD hh:mm:ss +0000] critical/config: Error: Validation failed
for object 'DUMMYHOSTL!FANCY_SERVICE-NAME-A!MYFANCYDOWNTIME' of type
'ScheduledDowntime'; attribute 'ranges' -> 'excludes': Invalid type.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the ScheduledDowntime and TimePeriod behavior described in the issue, then trace validation for ScheduledDowntime.ranges.excludes. Compare how TimePeriod includes, excludes, and holiday calendars are represented. Done means scheduled downtimes accept equivalent range references without the reported Invalid type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100