Alert Notifications - Grace Period
Each notification instance needs an optional grace period that can be used to avoid flooding users with notifications. In the old system the grace period was configured on the alert condition and not on the notification. Making it configurable for every notification instance makes it way more flexible because each notification for an event can use a different grace period.
The job that sends a notification checks if a notification has been sent in the configured time range. Example: Grace period of 10 minutes means, when the notification job gets executed it checks if a notification has been sent for this event type in the last 10 minutes. If that's the case, no notification will be sent.
It should be possible to configure if the grace period applies to the event definition or for the event definition + the event key.
Example: A grace period of 10 min is configured for the email notification "My Alert Email". Within 7 minutes there are three events that trigger the notification EventA[key="a"], EventA[key="a"] and EventA[key="b"].
- Grace period with event key check: two notifications would be sent. One for the first event with key "a" and one for the first event with key "b". (because events with key "a" are different from events with key "b")
- Grace period without event key check: only one notification would be sent. One for the first event with key "a". (we only allow one notification for the event type, no matter what key it has)
If there wouldn't have been a grace period configured in the example above, there would be one notification for each event.
When a grace period is configured for a notification instance, it's used as the default. A user should be able to override this on a per event definition basis, though. (notification job parameters)
The grace period for notifications can probably be implemented by running ES aggregations on the notification job history records.