feat: add alerts for indexer lag and source failures#834
Open
supremeproton01 wants to merge 4 commits into
Open
feat: add alerts for indexer lag and source failures#834supremeproton01 wants to merge 4 commits into
supremeproton01 wants to merge 4 commits into
Conversation
|
@supremeproton01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
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.
Summary
Lag Metrics Produced ✅
Stellar Ledger Lag: Tracks how far behind we are from the latest Stellar ledger (via Horizon API)
Table Ingestion Lag: Measures staleness for articles, social_posts, analytics_records, and contract_events
Configurable Thresholds: Warning and critical severity levels per metric type
Alerts Configured ✅ (Log-Based for MVP)
⚠️ Warning Indexer Lag (>2 minutes)
⚠️ Data Source Failures (3+ in 5 min window)
4 Alert Rules:
🚨 Critical Indexer Lag (>10 minutes)
🚨 Pipeline Falling Behind (2+ stale sources)
Dispatch Methods: Structured JSON logging + optional Telegram/webhooks
Runbook Documented ✅
ALERTING_RUNBOOK.md (1000+ lines): Complete operations guide with procedures
ALERTING_INTEGRATION_GUIDE.md (400+ lines): Integration steps with code examples
QUICK_REFERENCE.md: Quick lookup guide
📦 Deliverables
Core Implementation (1,100 LOC)
src/metrics/indexer_lag.py - Metrics collection
src/metrics/alerting_rules.py - Alert rules engine
src/metrics/ingestion_monitoring.py - Job orchestrator
src/metrics/init.py - Module exports
Testing (380 LOC)
tests/test_metrics_alerting.py - 30+ unit tests
Documentation & Demo
ALERTING_RUNBOOK.md - Operations guide
ALERTING_INTEGRATION_GUIDE.md - Integration guide
IMPLEMENTATION_SUMMARY.md - Delivery summary
QUICK_REFERENCE.md - Quick lookup
demo_indexer_lag_alerting.py - Interactive demo
Closes #745
Type of Change
Validation
Documentation
Checklist
feat/,fix/, ordocs/