-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
notify: replace unfiltered with filtered alerts #595
Conversation
Testing now.... Again using the following script :
webhook output
I don't get the RESOLVED sections anymore but might have found another issue. Some questions :
|
I am assuming this was produced with the config pasted in #591. In that case this is the correct behavior.
|
Actually rethinking that, I think you might be right, as the |
Correct .... I guess alertmanager is sending out notifications when it thinks the alert content has changed within a group and within the group_interval. In my test case this is what causing the 4 notifications (where I think it should only be sending 2). So although the fix here removes the This comes from the needsUpdate function in notify.go :
I guess the hash will not be sufficient to determine if an alert should be sent. If all alerts (including the resolved ones) within a group are hashed it could explain the 4 notifications: My results :
Notification 2
Notification 3
Notification 4
So from Alertmanager perspective, the content has changed each time. The 5th run it will again see |
Hi @brancz / @fabxc / @brian-brazil : Any thoughts on how AlertManager should handle this particular test case ? What would be the expected outcome here ? Only 2 notifications (the first first 2) instead of the actual 4 that we are getting ? |
Per the docs it should just be 1&2, there's an argument for 1&2&3 but I think that'd end up spammy. |
@brian-brazil : agreed ... should this also be fixed in this PR or would a separate one be better ? This PR will now have the side-effect of duplicate emails (before this fix they weren't considered duplicates because they would also included the resolved alerts). The hash calculation was probably done for a reason (strictness / performance / ....) so I don't know how big of an impact a full fix would have. (but it seems to be isolated in the |
It'd be good to fix it completely, but this PR brings us closer to correctness. I imagine the full fix will be fairly involved. |
Agreed. As this fixes one behavior we should have this reviewed, and then look at the other problem separately. |
ok ... I'll create a separate issue for the spammy emails |
👍 |
Fixes #591
We we're actually testing the
len(res) == 0
condition in the tests so we didn't notice the problem, as we always filtered all alerts in the tests.@fabxc @brian-brazil @alexsomesan
@ddewaele you mentioned in #591 that you would volunteer to test a fix. I'm pretty confident it works correctly now, but won't hurt to try in your environment.