feat(alerts): Bridge alerting to PagerDuty / Slack / Discord [ENG-361]#391
Open
islandbitcoin wants to merge 3 commits into
Open
feat(alerts): Bridge alerting to PagerDuty / Slack / Discord [ENG-361]#391islandbitcoin wants to merge 3 commits into
islandbitcoin wants to merge 3 commits into
Conversation
…361] Severity-routed best-effort alert fan-out: critical pages PagerDuty + informs Slack/Mattermost + Discord; warning informs only. Each sender no-ops when its env credential is unset. Config: ALERT_PAGERDUTY_ROUTING_KEY / ALERT_SLACK_WEBHOOK_URL / ALERT_DISCORD_WEBHOOK_URL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fire-and-forget alertBridge() at the Bridge failure points (alongside existing logging), all critical/page: - ERPNext audit-write failures (deposit + transfer completed/failed) - Bridge webhook processing exceptions (deposit + transfer catch) - Bridge API outage in client.request(): 5xx / timeout / network (4xx not alerted) IBEX-error source deferred: on-receive.ts is general LN/onchain receive handling, not the Bridge<->IBEX movement path; needs the exact call site (warning sev). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
ENG-361 — Wire Bridge alerts to PagerDuty / Slack (+ Discord)
Adds an
AlertService(src/services/alerts) and wires it into the Bridge failure points so ops gets paged/informed when Bridge integration signals fail.Routing
Best-effort + fire-and-forget — a failing or unconfigured destination never blocks or fails the webhook/request path. A destination with no configured credential is silently skipped.
Alert sources wired
bridge/webhook-server/routes/{deposit,transfer}.tsbridge/client.tson-receive.tsis general LN/onchain receive handling, not the Bridge↔IBEX path; needs the exact call site4xxfrom Bridge are normal rejections and are not alerted.⚙️ Setup — env values (required for alerts to actually deliver)
The wiring ships dormant; each destination activates only when its env var is set. If none are set, alerting is a no-op (no errors, no delivery).
ALERT_PAGERDUTY_ROUTING_KEYALERT_SLACK_WEBHOOK_URLALERT_DISCORD_WEBHOOK_URLHow to obtain each:
{ text }payload.)Where to set:
.env(and.env.cifor CI).MATTERMOST_WEBHOOK_URL. Treat all three as secrets.Full guide:
docs/bridge-integration/ALERTING.md.Verifying in staging (acceptance)
ALERT_PAGERDUTY_ROUTING_KEY+ALERT_SLACK_WEBHOOK_URLin staging.Notes
AlertService+ 3 config lines + wiring). Touched files type-check; new files lint clean. (The branch has pre-existing eslint/prettier debt in the files I touched — not introduced here.)🤖 Generated with Claude Code