Skip to content

feat: Implement four essential monitoring features (#1093 #1089 #1090 #1091) - #1122

Merged
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
Akanimoh12:feature/alert-noise-reduction-soroban-trends-ledger-delays
Aug 26, 2026
Merged

feat: Implement four essential monitoring features (#1093 #1089 #1090 #1091)#1122
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
Akanimoh12:feature/alert-noise-reduction-soroban-trends-ledger-delays

Conversation

@Akanimoh12

Copy link
Copy Markdown
Contributor

Summary

This PR implements comprehensive backend infrastructure for four major monitoring capabilities.

Issue #1093: Alert Noise Reduction Recommendations

  • Analyze alert firing patterns and false positive rates
  • Generate actionable recommendations to reduce alert fatigue
  • Support threshold adjustments, alert suppression, and correlation filtering

Issue #1089: Soroban Invocation Cost Trends

  • Record Soroban contract invocation costs with CPU, memory, and network metrics
  • Compute cost trends across multiple granularities
  • Detect cost anomalies with configurable baselines

Issue #1090: Ledger Close Delay Alerts

  • Monitor Stellar ledger closure timing and identify delays
  • Create alerts for delays exceeding thresholds
  • Compute delay statistics and detect patterns

Issue #1091: Horizon Cursor Audit History

  • Maintain audit trail for cursor position changes
  • Track cursor advances, resets, and rollbacks
  • Support cursor reconciliation between local state and Horizon

Database Migrations

  • 055_alert_noise_reduction.ts
  • 056_soroban_invocation_cost_trends.ts
  • 057_ledger_close_delay_alerts.ts
  • 058_horizon_cursor_audit_history.ts

Services

  • alertNoiseReduction.service.ts
  • sorobanInvocationCost.service.ts
  • ledgerCloseDelay.service.ts
  • horizonCursorAudit.service.ts

API Routes

  • alertNoiseReduction.routes.ts
  • sorobanInvocationCost.routes.ts
  • ledgerCloseDelay.routes.ts
  • horizonCursorAudit.routes.ts

Closes #1093 Closes #1089 Closes #1090 Closes #1091

…tellaBridge#1089 StellaBridge#1090 StellaBridge#1091)

## Summary

Implement comprehensive backend infrastructure for four major monitoring capabilities:

### Issue StellaBridge#1093: Alert Noise Reduction Recommendations
- Analyze alert firing patterns and false positive rates
- Generate actionable recommendations to reduce alert fatigue
- Support threshold adjustments, alert suppression, and correlation filtering
- Track recommendation status and application metrics

### Issue StellaBridge#1089: Soroban Invocation Cost Trends
- Record Soroban contract invocation costs with CPU, memory, and network metrics
- Compute cost trends across multiple granularities (hourly/daily/weekly/monthly)
- Detect cost anomalies with configurable baselines and deviation thresholds
- Provide historical cost analysis and p-percentile tracking

### Issue StellaBridge#1090: Ledger Close Delay Alerts
- Monitor Stellar ledger closure timing and identify delays
- Create alerts for delays exceeding configurable thresholds
- Compute delay statistics and detect recurring patterns
- Support pattern analysis for time-of-day and burst detection

### Issue StellaBridge#1091: Horizon Cursor Audit History
- Maintain comprehensive audit trail for cursor position changes
- Track cursor advances, resets, and rollbacks with full provenance
- Support cursor reconciliation between local state and Horizon
- Implement rollback workflows with severity classification and reprocessing flags

## Implementation Details

**Database Migrations:**
- 055_alert_noise_reduction.ts: Analysis results and recommendations
- 056_soroban_invocation_cost_trends.ts: Invocation costs, trends, and anomalies
- 057_ledger_close_delay_alerts.ts: Closure events, alerts, and pattern detection
- 058_horizon_cursor_audit_history.ts: Cursor positions, audit logs, rollbacks, and reconciliations

**Services:**
- alertNoiseReduction.service.ts: Analysis engine with recommendation generation
- sorobanInvocationCost.service.ts: Cost tracking and trend computation
- ledgerCloseDelay.service.ts: Delay monitoring and pattern detection
- horizonCursorAudit.service.ts: Cursor state management and audit trail

**API Routes:**
- alertNoiseReduction.routes.ts: Analysis CRUD and recommendation lifecycle
- sorobanInvocationCost.routes.ts: Invocation recording and trend queries
- ledgerCloseDelay.routes.ts: Event recording and statistics computation
- horizonCursorAudit.routes.ts: Cursor operations and reconciliation workflows

**Route Groups:**
- Updated alert-routes.ts to register noise reduction endpoints
- Updated analytics-routes.ts to register Soroban cost tracking endpoints
- Created operational-monitoring-routes.ts for ledger and cursor endpoints
- Registered operational-monitoring-routes in main routes index

## Acceptance Criteria Met

✓ Documented API and persistence contracts with schemas
✓ Failure, retry, authorization, and observability behavior covered
✓ Existing consumers remain compatible with new optional endpoints
✓ Service boundaries follow established patterns (database, service, routes)
✓ Operational documentation via schema definitions and error handling

Closes StellaBridge#1093, Closes StellaBridge#1089, Closes StellaBridge#1090, Closes StellaBridge#1091.
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Akanimoh12 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! 🚀

Learn more about application limits

@Mosas2000

Copy link
Copy Markdown
Contributor

Perfect work.

@Mosas2000
Mosas2000 merged commit aa92bd2 into StellaBridge:main Aug 26, 2026
16 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

2 participants