Add Recovery Notifications and Status Metadata#3
Merged
mosishon merged 3 commits intoFeb 3, 2026
Conversation
- Added `notify_on_recovery` to Service configuration. - Added `Status` field (UP/DOWN) to `NotificationMetadata`. - Implemented recovery notification logic in `HealthChecker`. - Moved `failureCount` to `HealthChecker` struct for better state management. - Updated notification templates (Webhook, SMS, Mail) to support recovery messages. - Fixed template field inconsistencies in `sample.yaml`. Co-authored-by: mosishon <61285975+mosishon@users.noreply.github.com>
…porting - Implemented `TemplateGroup` for intelligent notification selection. - Added categorized failure types (Network, HTTP, SlowResponse, ConditionFailed). - Enhanced `EvaluationResult` with detailed recursive failure reporting for AND/OR. - Updated all notifiers (Webhook, SMS, MeliPayamak, Email) to support smart templating. - Added `notify_on_recovery` flag and logic. - Created "God-mode" `sample.yaml` showcasing all features. - Updated `README.md` with comprehensive documentation on metadata and templates. - Fixed `notifier/mail.go` imports and updated tests. Co-authored-by: mosishon <61285975+mosishon@users.noreply.github.com>
- Defined high-quality English templates for NetworkError, HttpError, SlowResponse, ConditionFailed, and Recovery.
- Every default template includes mandatory timestamp and semantic emojis.
- Updated `WebhookNotifier`, `PayamakNotifier`, and `MailNotifier` to use these defaults as fallbacks.
- Intelligent override for generic webhook messages to provide more detailed built-in alerts.
- Ensured consistent use of `{{.Metadata.ServiceURL}}` for monitored endpoint info.
Co-authored-by: mosishon <61285975+mosishon@users.noreply.github.com>
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.
This PR implements the requested recovery notification feature.
Key changes:
notify_on_recoveryboolean to theServicestruct.Statusfield toNotificationMetadatato distinguish between "UP" and "DOWN" states.HealthCheckerto track whether a service was previously "down" (threshold reached). If it recovers andnotify_on_recoveryis enabled, a recovery notification is sent.failureCountfrom a local variable to theHealthCheckerstruct to ensure consistent state management along with the newisDownflag.Statusfield and provided better default templates.sample.yamltemplates that were using old or incorrect paths (e.g., using.Metadata.ServiceURLinstead of.URLwhich referred to the recipient).