-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat(notifier, api): fix sending notifications on muted and deleted triggers #946
feat(notifier, api): fix sending notifications on muted and deleted triggers #946
Conversation
…nding-on-muted-and-deleted-triggers
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## feat/add-redis-notifier-config #946 +/- ##
==================================================================
+ Coverage 69.05% 69.14% +0.09%
==================================================================
Files 196 196
Lines 11092 11199 +107
==================================================================
+ Hits 7660 7744 +84
- Misses 2985 2999 +14
- Partials 447 456 +9
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
return nil, err | ||
} | ||
|
||
for i, triggerID := range triggerIDs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут тоже же можно от i избавиться))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А как избавиться? Тут i нужно, для доступа к соответствующим значениям в другом массиве
/build |
Build and push Docker images with tag: feat-fix-sending-on-muted-and-deleted-triggers.2023-11-13.7acacd8 |
…n-muted-and-deleted-triggers
Fix sending notifications on muted and deleted triggers and muted metrics
This PR solves the problem of unwanted notifications being sent on triggers or metrics to Maintenance or removed triggers
To do this, for each notification we collect a
checkData
array (optimized for the case where there are many notifications with the same timestamp). If there is no trigger, the correspondingcheckData
= nil, whether a trigger or a metric is on Maintenance can be found by the Maintenance fieldFor optimization purposes, all notifications are divided into delayed and not delayed notifications and all checks needed for validation are performed on delayed notifications. Also all validations are done in a single transaction to avoid data race
Notification types have also been added:
valid
- correct notificationsremoved
- incorrect notifications (for example, with a removed trigger).ignored
- notifications whose trigger or metric is on MaintenanceDivided 1 big PR into 3 parts, here are the rest: