Alarm constrained by time-of-day or day-of-week

Registered by Eoghan Glynn

Currently, alarm evaluation works the same way regardless of the time of the day or the day of the week.

However, it would be useful to have the flexibility to set the bar higher or lower at different times of the day or days of the week. For example to do one thing if the alarm condition occurs during normal working hours, but do something else if it occurs at the weekend.

A typical usecase would be an autoscaling group with a more aggressive scale-up policy at the weekend (i.e. scaling up quicker & farther when the under-scaled alarm fires) because instance hours might be cheaper at this time, and operations man-power is generally less abundant (so that manual remediation, if required, would be more awkward).

This would not necessitate adding yet another alarm type (in addition to the existing threshold-oriented and meta-alarms). Instead this requirement could be met by encoding the time constraints in the alarm definition and considering this as part of the generic alarm evaluation.

The fine-grained design decisions and implementation tasks would include:

* decide how many time-constraints may be associated with an individual alarm (1:1, or M:1 combined using logical OR)

* decide how the time-constraints associated with an alarm are accommodated within the alarm storage model
** if encoded directly in the alarm rule, then this would not require a substantive change to the schema via a DB migration

* decide how to represent the time-constraints in a concise and easily-understood way
** a convenient and widely-understood way of expressing such constraints would be via cron expressions (though such expressions are better suited to capturing specific times as opposed to time-ranges)

* add the logic to enforce the time-constraints within the ceilometer.alarm.evaluator.Evaluator super-class, then modify the threshold and combination sub-classes such that assigned alarms do not transition into the alarm state if their time-constraints are not met

* add support for time-constraint to the pthyon-ceilometerclient client librray & CLI, such that alarms can be created with such constraints, these constraints can be retrieved and updated etc.

Blueprint information

Julien Danjou
Eoghan Glynn
Nejc Saje
Series goal:
Accepted for icehouse
Milestone target:
milestone icon 2014.1
Started by
Eoghan Glynn
Completed by
Julien Danjou

Related branches



Suggestion for the solution:

If ok with you, Nejc Saje and me can start working on this.

Gerrit topic:,topic:bp/time-constrained-alarms,n,z

Addressed by:
    Adds time constraints to alarms [WIP]


Work Items

This blueprint contains Public information 
Everyone can see this information.