Great work! Including a way to set grace periods will be really useful to prevent flapping on the metrics. ex, 'Alert When CPU > 95% for 10m'
This means that the lowest value for the last 5min of the serie have to be above 80% before the alert triggers.