Skip to content

Add Recovery Notifications and Status Metadata#3

Merged
mosishon merged 3 commits into
mainfrom
feature/recovery-notifications-2363762929766357473
Feb 3, 2026
Merged

Add Recovery Notifications and Status Metadata#3
mosishon merged 3 commits into
mainfrom
feature/recovery-notifications-2363762929766357473

Conversation

@mosishon
Copy link
Copy Markdown
Owner

@mosishon mosishon commented Feb 3, 2026

This PR implements the requested recovery notification feature.

Key changes:

  1. Config Update: Added notify_on_recovery boolean to the Service struct.
  2. Metadata Update: Added a Status field to NotificationMetadata to distinguish between "UP" and "DOWN" states.
  3. Logic Update: Updated HealthChecker to track whether a service was previously "down" (threshold reached). If it recovers and notify_on_recovery is enabled, a recovery notification is sent.
  4. Refactoring: Moved failureCount from a local variable to the HealthChecker struct to ensure consistent state management along with the new isDown flag.
  5. Template Updates: Updated all notifiers (Webhook, SMS, MeliPayamak, Mail) to use the new Status field and provided better default templates.
  6. Bug Fixes: Corrected field names in sample.yaml templates that were using old or incorrect paths (e.g., using .Metadata.ServiceURL instead of .URL which referred to the recipient).

- 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>
Repository owner deleted a comment from google-labs-jules Bot Feb 3, 2026
google-labs-jules Bot and others added 2 commits February 3, 2026 04:50
…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>
@mosishon mosishon merged commit 8a8661e into main Feb 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant