Skip to content

feat: escrow low-balance alerting with Prometheus counter (Closes #45) - #59

Open
ZacLou wants to merge 4 commits into
StellarRoute:mainfrom
ZacLou:feat/issue-45-escrow-low-balance-alert
Open

feat: escrow low-balance alerting with Prometheus counter (Closes #45)#59
ZacLou wants to merge 4 commits into
StellarRoute:mainfrom
ZacLou:feat/issue-45-escrow-low-balance-alert

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 27, 2026

Copy link
Copy Markdown

Closes #45

Changes

Implements escrow low-balance alerting per PRD Section 8:

  • Config: Added ESCROW_LOW_BALANCE_THRESHOLD env var (default 0 = disabled)
  • Alert function: check_escrow_balance_alert() in attestation.rs checks program escrow_balance after each payout
  • Prometheus counter: waveflow_gateway_escrow_low_balance_total increments when balance drops below threshold
  • Logging: tracing::warn! with program_id, repo, balance, and threshold fields
  • Integration: Wired into process_merge() in routes.rs, called after increment_milestone_spent()
  • .env.example: Added documentation for the new threshold variable

Files changed

  • crates/shared/src/config.rs — Added escrow_low_balance_threshold field
  • crates/gateway/src/attestation.rs — Added check_escrow_balance_alert() function
  • crates/gateway/src/routes.rs — Wired alert into payout processing pipeline
  • .env.example — Documented ESCROW_LOW_BALANCE_THRESHOLD

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.

[gateway] Escrow low-balance alerting (PRD Section 8)

1 participant