Skip to content

Conversation

@eyazici90
Copy link
Contributor

@eyazici90 eyazici90 commented Apr 18, 2025

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.

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>
@eyazici90 eyazici90 marked this pull request as ready for review April 18, 2025 12:47
}
}

func TestSlackTimeout(t *testing.T) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@rajagopalanand rajagopalanand left a 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

@eyazici90
Copy link
Contributor Author

@grobinson-grafana Could u help me with the review? 🙏

@eyazici90
Copy link
Contributor Author

Could u help me with review @SuperQ ?

Signed-off-by: Ben Kochie <superq@gmail.com>
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SuperQ SuperQ merged commit 9ec88ae into prometheus:main Oct 19, 2025
11 checks passed
@SoloJacobs SoloJacobs mentioned this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants