feat: add Slack SR guard and resilient SR monitor#123
Open
warku123 wants to merge 7 commits into
Open
Conversation
Trigger a phone call via an optional PHONE_ALERT_URL webhook on the same Top 27 membership change condition that already sends the Slack alert, independent of and non-blocking to the existing Slack path.
Add phone-call escalation to slack_sr_guard
This file contains hidden or 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
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.
What does this PR do?
Adds a new Slack SR guard tool alongside the existing Slack SR monitor, and refactors
tools/slack_sr_monitorso both tools can run from one Docker image.The monitor sends SR reports after each maintenance period. The new guard checks the current Top 27 SR set every minute and sends a Slack alert if any SR enters or leaves the Top 27 before maintenance. It also supports an optional phone-call escalation endpoint after the Slack alert is delivered successfully.
Why are these changes required?
The existing SR monitor only reports after maintenance. If community votes push an SR out of the Top 27 before the next maintenance period, there was no early warning.
This PR adds a lightweight guard for that risk, while also improving reliability around node fallback, state persistence, maintenance-time retries, and optional urgent phone escalation.
Changes overview:
sr_guard.goto check Top 27 membership every minute and alert on entered/left SRsPHONE_ALERT_URLsupport for phone-call escalation after a successful Slack guard alertmain.go,sr_monitor.go, andsr_guard.gomonitor,guard, and defaultbothrun modes from one binaryTRON_NODES, withTRON_NODEkept as fallbackSLACK_WEBHOOKas common fallbacklogs/.env.example, and README usage docsThis PR has been tested by:
go test ./...go builddocker compose config --quietExtra details