{{ message }}
Repository navigation
[bugfix] resolve firing alerts when a monitor is deleted (#2402) - #4478
Open
markjoin123 wants to merge 1 commit into
Open
markjoin123 wants to merge 1 commit into
markjoin123 wants to merge 1 commit into
Conversation
Deleting a monitor cancels collection, so a firing alert can never recover and group convergence keeps resending it. Close those alerts on delete without emitting another notification. Co-authored-by: markxu <markjoin123@users.noreply.github.com>
This branch has not been deployed
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's changed?
Fixes #2402.
Deleting a monitor cancels its collection job. A firing alert for that monitor can never receive the metrics sample that would recover it, so group convergence keeps resending the notification. The content shows only the raw monitor id because the monitor row is already gone.
MonitorDeletedEventpreviously only cleaned push-gateway state. Real-time alerts already carryhertzbeat.monitor.id, so after the delete transaction commits this change:No recovery notification is sent. The monitor no longer exists, and another notice would repeat the orphaned alert.
Checklist
Add or update API
Validation
./mvnw -pl hertzbeat-alerter -am install -DskipTests— checkstyle reports 0 violations./mvnw -pl hertzbeat-alerter test— Tests run: 709, Failures: 0, Errors: 0, Skipped: 0AI assistance: implementation draft.
Human validation: checkstyle and the full
hertzbeat-alerterunit-test run above.Risk notes: alerts created before
hertzbeat.monitor.idwas stored cannot be matched by monitor id. A sample that arrives more than 30 minutes after deletion is no longer suppressed.