slack: retry on 429 and honor Retry-After header#5048
slack: retry on 429 and honor Retry-After header#5048biwwy0 wants to merge 1 commit intoprometheus:mainfrom
Conversation
Make HTTP 429 (Too Many Requests) retryable for the Slack notifier by adding http.StatusTooManyRequests to the retrier's RetryCodes, matching the pattern already used by PagerDuty, OpsGenie, Jira, and incident.io. Additionally, parse the Retry-After response header on 429 responses and sleep for the indicated duration before returning. This addresses the concern raised when a similar change was reverted in prometheus#2128: simply retrying 429 without honoring Retry-After causes rapid-fire retries that risk getting apps permanently disabled by Slack. The sleep respects context cancellation. Fixes prometheus#2111 Ref prometheus#2205 Signed-off-by: Anton Ivanov <antonivanov@bitgo.com>
|
Hi @biwwy0 thank you for your contribution, I do think this is good however I think we should take the time and fix this for all notifiers. There is multiple notifiers currently that just set |
|
After checking again there is one issue here. After waiting the |
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
|
@TheMeier Please let me know if you want me to change something here? I looked into moving |
|
I can't follow the reasoning. I think it should be possible to unify the handling of 429 accross all notifiers, regardless of special handling of other return codes in some notifieres. On top the reason for #2128 also applies for all notifieres that currently just set |
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
add generic handling of 429 in retier. This will allow to remove any handling of 429 in the individual notifiers and instead rely on the retier to handle it (TBD in follow-up PRs). Fixes prometheus#2205 Refs: prometheus#5048 Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
Make HTTP 429 (Too Many Requests) retryable for the Slack notifier by adding http.StatusTooManyRequests to the retrier's RetryCodes, matching the pattern already used by PagerDuty, OpsGenie, Jira, and incident.io.
Additionally, parse the Retry-After response header on 429 responses and sleep for the indicated duration before returning. This addresses the concern raised when a similar change was reverted in #2128: simply retrying 429 without honoring Retry-After causes rapid-fire retries that risk getting apps permanently disabled by Slack. The sleep respects context cancellation.
Fixes #2111
Ref #2205
Pull Request Checklist
Please check all the applicable boxes.
benchstatto compare benchmarksWhich user-facing changes does this PR introduce?