Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support delayed notifications #166

Open
Tracked by #121
lunkwill42 opened this issue Sep 28, 2020 · 5 comments
Open
Tracked by #121

Support delayed notifications #166

lunkwill42 opened this issue Sep 28, 2020 · 5 comments
Labels
enhancement New feature or request notification Affects the notification system queue

Comments

@lunkwill42
Copy link
Member

Argus needs at minimum two types of delayed notifications (this definitely post-1.0)

It should be possible to configure a subscription that will queue all notifications generated in a timeslot, and send these in bulk, when either

  1. The next timeslot begins.
  2. OR at a specific time of the day/week.

In addition, this type of subscription needs an option to drop notifications related to any incident that was closed/resolved before the notification is actually sent (i.e. the "Tell me everything that went wrong last night while I was sleeping, but only the things that are still issues" function)

@lunkwill42 lunkwill42 added the enhancement New feature or request label Sep 28, 2020
@hmpf hmpf added this to the blue sky milestone Sep 29, 2020
@hmpf hmpf added the notification Affects the notification system label Sep 29, 2020
@hmpf
Copy link
Contributor

hmpf commented Oct 1, 2020

Idea: NotificationQueue model, with foreign key to Event. (Potential problem with stateless incidents, they only have start events.)

class NotificationQueue(models.Model):
    event = models.ForeignKey(Event, .., related_name='sent', ..)
    received = models.DatetImeField(default=now, ..)
    profiles = models.ManyToManyField(NotificationProfile, .., related_name="queues")

The queue will only see adds and deletes. On handover to notification sender, checks if incident is closed, if so: deletes from queue immediately.

class NotificationStatus(models.Model):
    event = models.OneToOneKey(Event, .., related_name='sent', ..)
    received = models.DatetImeField(blank=True, null=True, ..)
    sent = models.DatetImeField(blank=True, null=True, ..)
    profiles = models.ManyToManyField(NotificationProfile, .., related_name="queues")

After a notification is handed over to the notification sender, NotificationStatus is updated and the entry in NotificationQueue is deleted. (In one transaction.)

Both done in another process.

@hmpf hmpf modified the milestones: Blue sky, New notification system Oct 2, 2020
@katsel
Copy link
Contributor

katsel commented Jan 18, 2021

From today's CNaaS-sync-meeting:

@katsel
Copy link
Contributor

katsel commented Jan 18, 2021

May also touch on #209. After "pausing" a notification profile, the user may want a digest of what happened.

Also, I am not sure how common recurring incidents are (where all attributes are equal except the timestamp), but we may want to collapse these incidents into one, just adding a number and time frame.

So instead of

9:00 Incident X
9:07 Incident X
9:10 Incident X
...

user gets

Incident X happened 20 times between 9 and 12.

@lunkwill42
Copy link
Member Author

This is relevant as a sub-part of #121

@hmpf
Copy link
Contributor

hmpf commented Sep 8, 2022

Depends on #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request notification Affects the notification system queue
Projects
None yet
Development

No branches or pull requests

3 participants