-
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
add reason code to slack notifier #3252
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this uses the new error with reason to determine based on status code what the reason is for the slack integration partial #3231 Signed-off-by: gotjosh <josue.abreu@gmail.com>
gotjosh
force-pushed
the
slack_reason
branch
from
February 15, 2023 13:54
c9c307a
to
c6b6ea8
Compare
Signed-off-by: gotjosh <josue.abreu@gmail.com>
gotjosh
force-pushed
the
slack_reason
branch
from
February 16, 2023 15:43
ce1e8dd
to
ece5dce
Compare
Signed-off-by: gotjosh <josue.abreu@gmail.com>
simonpasquier
approved these changes
Mar 7, 2023
knyar
reviewed
Apr 29, 2023
@@ -213,5 +217,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) | |||
// https://api.slack.com/changelog/2016-05-17-changes-to-errors-for-incoming-webhooks | |||
retry, err := n.retrier.Check(resp.StatusCode, resp.Body) | |||
err = errors.Wrap(err, fmt.Sprintf("channel %q", req.Channel)) | |||
return retry, err | |||
reasonErr := notify.NewErrorWithReason(notify.GetFailureReasonFromStatusCode(resp.StatusCode), err) |
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.
Does not this make Notify
return a non-nil error even when err
is nil here?
UPD: fixing as part of #3121
gotjosh
added a commit
that referenced
this pull request
May 2, 2023
This was introduced as part of #3252 and its a case I didn't really took into account. Signed-off-by: gotjosh <josue.abreu@gmail.com>
gotjosh
added a commit
that referenced
this pull request
Aug 7, 2023
* add reason code to slack notifier this uses the new error with reason to determine based on status code what the reason is for the slack integration partial #3231 Signed-off-by: gotjosh <josue.abreu@gmail.com> * Add some tests Signed-off-by: gotjosh <josue.abreu@gmail.com> * Handle the error Signed-off-by: gotjosh <josue.abreu@gmail.com> --------- Signed-off-by: gotjosh <josue.abreu@gmail.com>
radek-ryckowski
pushed a commit
to goldmansachs/alertmanager
that referenced
this pull request
Nov 6, 2023
* add reason code to slack notifier this uses the new error with reason to determine based on status code what the reason is for the slack integration partial prometheus#3231 Signed-off-by: gotjosh <josue.abreu@gmail.com> * Add some tests Signed-off-by: gotjosh <josue.abreu@gmail.com> * Handle the error Signed-off-by: gotjosh <josue.abreu@gmail.com> --------- Signed-off-by: gotjosh <josue.abreu@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this uses the new error with reason to determine based on status code what the reason is for the slack integration
partial #3231
While I'm the committer of this message, I had no doing in the actual code and instead, the list of individuals below are to be contributed:
@alexmobo @zzehring @suntala @gloriasc @katebrenner @ktw4071