Summary
oracle/src/health/alerting.service.ts exists but likely only logs alerts internally. Operators need to receive external alerts (PagerDuty, Slack webhook, or email) when critical conditions occur: circuit OPEN, DLQ threshold exceeded, or key rotation failure.
What to do
- Add
ALERT_WEBHOOK_URL and ALERT_PAGERDUTY_KEY to the oracle env schema (both optional).
- In
AlertingService.sendAlert(level, message, context):
- If
ALERT_WEBHOOK_URL is set, POST a JSON payload to the URL (Slack-compatible format).
- If
ALERT_PAGERDUTY_KEY is set, use PagerDuty's Events API v2.
- Trigger alerts for: circuit breaker OPEN, DLQ depth > configurable threshold, VRF key unavailable.
- Include
oracle_id, raffle_id (if applicable), and severity in the alert payload.
- Write a unit test mocking the HTTP client to assert alert payloads are correctly formed.
Acceptance criteria
- Setting
ALERT_WEBHOOK_URL causes alerts to POST to that URL when the circuit opens.
- Alert payload contains enough context to diagnose the issue without SSH access.
Summary
oracle/src/health/alerting.service.tsexists but likely only logs alerts internally. Operators need to receive external alerts (PagerDuty, Slack webhook, or email) when critical conditions occur: circuit OPEN, DLQ threshold exceeded, or key rotation failure.What to do
ALERT_WEBHOOK_URLandALERT_PAGERDUTY_KEYto the oracle env schema (both optional).AlertingService.sendAlert(level, message, context):ALERT_WEBHOOK_URLis set, POST a JSON payload to the URL (Slack-compatible format).ALERT_PAGERDUTY_KEYis set, use PagerDuty's Events API v2.oracle_id,raffle_id(if applicable), andseverityin the alert payload.Acceptance criteria
ALERT_WEBHOOK_URLcauses alerts to POST to that URL when the circuit opens.