-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: add timeout option for slack notifier #4355
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
Conversation
This is to manager timeout for the context that is passed to slack calls. Group level context is set to wider intervals such as 5mins, whereas we would like to set lower level threasholds for slack integrations to have limit on retries and intermediate blockers in the network. Signed-off-by: emreya <e.yazici1990@gmail.com>
Signed-off-by: emreya <e.yazici1990@gmail.com>
To see if timeout option is obeyed. Signed-off-by: emreya <e.yazici1990@gmail.com>
| } | ||
| } | ||
|
|
||
| func TestSlackTimeout(t *testing.T) { |
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.
Do we want to add a test case to show if parent context is canceled, then child context also gets canceled?
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.
Not sure about the value that would bring. do we aim to check if context is propagated to downstream funcs? I haven't seen any test like that for other places in AM. Could u point me to an example? Perhaps I missed it.
rajagopalanand
left a comment
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.
Had one question regarding a test case
|
@grobinson-grafana Could u help me with the review? 🙏 |
|
Could u help me with review @SuperQ ? |
Signed-off-by: Ben Kochie <superq@gmail.com>
SuperQ
left a comment
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.
Thanks!
Context
This is to manage timeout for the context that is passed to slack calls. Group level context is set to wider intervals on the dispatcher such as 5mins default, whereas we would like to set lower level thresholds for slack integrations to have limit on retries and intermediate blockers in the network.
Relates to #4348
Case
In our setup with HA usage of AM, we use proxy for egress comm from alertmanagers to slack(mattermost) that sits in between. Our proxy may lead to block such calls taking way longer than expected leading to no retries and hanging connections at alertmanager side as the parent context is set at dispatcher that is group interval.
We should be able to set smaller duration timeout for outgoing calls to slack, consequently having more controls for robust communication.