Skip to content

feat: add /api/stellar/metrics event-processing endpoint (#68)#79

Merged
robertocarlous merged 1 commit into
Neurowealth:mainfrom
Xaxxoo:feat/issue-68-stellar-metrics-endpoint
May 29, 2026
Merged

feat: add /api/stellar/metrics event-processing endpoint (#68)#79
robertocarlous merged 1 commit into
Neurowealth:mainfrom
Xaxxoo:feat/issue-68-stellar-metrics-endpoint

Conversation

@Xaxxoo
Copy link
Copy Markdown
Contributor

@Xaxxoo Xaxxoo commented May 26, 2026

Summary

  • Creates src/routes/stellar.ts with GET /api/stellar/metrics that returns the existing EventMetrics object from src/stellar/events.ts
  • Registers the router in src/index.ts under /api/stellar
  • Adds unit tests covering metric shape, zero-state, and error-rate calculation

Response shape

{
  "success": true,
  "data": {
    "totalProcessed": 120,
    "totalErrors": 3,
    "processingRatePerMinute": 14,
    "errorRate": 0.025,
    "ledgerLag": 2,
    "lastDbOperationMs": 8,
    "lastUpdated": "2024-03-03T14:30:00.000Z"
  }
}

Test plan

  • GET /api/stellar/metrics returns 200 with the metrics object
  • All fields present: totalProcessed, totalErrors, processingRatePerMinute, errorRate, ledgerLag, lastDbOperationMs, lastUpdated
  • Run npm test -- src/stellar/__tests__/stellar.test.ts — new metrics tests pass

Closes #68

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@Xaxxoo 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

@robertocarlous
Copy link
Copy Markdown
Contributor

pls resolve conflicts so i can merge

Resolves Neurowealth#68 - exposes getEventMetrics() from the Stellar event listener via
GET /api/stellar/metrics, returning totalProcessed, totalErrors, errorRate,
ledgerLag, processingRatePerMinute, lastDbOperationMs, and lastUpdated.
Registers the router in index.ts and adds unit tests for metric shape
and error-rate calculation.
@Xaxxoo Xaxxoo force-pushed the feat/issue-68-stellar-metrics-endpoint branch from 6cc7a7a to 7c207c4 Compare May 29, 2026 19:59
@robertocarlous robertocarlous merged commit df1dbf8 into Neurowealth:main May 29, 2026
1 of 2 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

Development

Successfully merging this pull request may close these issues.

Add event-processing metrics endpoint and monitoring support

2 participants