Skip to content

notify: classify Discord and Webex failure reasons#5324

Open
yuminn-k wants to merge 1 commit into
prometheus:mainfrom
yuminn-k:fix/3231-notifier-failure-reasons
Open

notify: classify Discord and Webex failure reasons#5324
yuminn-k wants to merge 1 commit into
prometheus:mainfrom
yuminn-k:fix/3231-notifier-failure-reasons

Conversation

@yuminn-k

@yuminn-k yuminn-k commented Jun 25, 2026

Copy link
Copy Markdown

Pull Request Checklist

Please check all the applicable boxes.

  • Please list all open issue(s) discussed with maintainers related to this change
  • Is this a new Receiver integration?
  • Is this a bugfix?
    • I have added tests that can reproduce the bug which pass with this bugfix applied
  • Is this a new feature?
    • I have added tests that test the new feature's functionality
  • Does this change affect performance?
    • I have provided benchmarks comparison that shows performance is improved or is not degraded
    • I have added new benchmarks if required or requested by maintainers
  • Is this a breaking change?
    • My changes do not break the existing cluster messages
    • My changes do not break the existing api
  • I have added/updated the required documentation
  • I have signed-off my commits
  • I will follow best practices for contributing to this project

Which user-facing changes does this PR introduce?

[BUGFIX] discord, webex: Classify failed notification metrics by HTTP status reason. #3231

Summary

Tests

  • make common-format
  • go test ./notify/discord
  • go test ./notify/webex
  • go test ./notify/...
  • /Users/yuminkim/go/bin/golangci-lint run ./notify/discord ./notify/webex
  • git diff --check

Notes

  • go test ./... was attempted, but this fresh checkout lacks built UI assets and local alertmanager/amtool binaries required by package setup and acceptance tests.
Signed-off-by: YuMin Kim <gimyumin40@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Discord and Webex now wrap retrier failures with reasons derived from HTTP status codes. New tests cover client and server error responses for both notifiers. The changelog records the bugfix.

Changes

Notification failure reasons

Layer / File(s) Summary
Retry-check errors carry reasons
notify/discord/discord.go, notify/webex/webex.go, CHANGELOG.md
Notify in both notifiers now wraps retrier check errors with notify.NewErrorWithReason(...) from the HTTP status code, and the unreleased changelog notes the bugfix.
Failure reasons are tested
notify/discord/discord_test.go, notify/webex/webex_test.go
Table-driven tests start httptest webhook servers for 400 and 500 responses and assert Notify returns *notify.ErrorWithReason with the expected notify.Reason.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the Discord/Webex failure-reason classification change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description follows the template and includes the checklist, linked issue, release notes, summary, tests, and notes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@siavashs

siavashs commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I think this should be fixed as part of #5332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants