Skip to content

fix(backend): track indexer event failures in health and admin metrics - #997

Open
TCROWN10 wants to merge 1 commit into
LabsCrypt:mainfrom
TCROWN10:fix/844-indexer-event-failure-counters
Open

fix(backend): track indexer event failures in health and admin metrics#997
TCROWN10 wants to merge 1 commit into
LabsCrypt:mainfrom
TCROWN10:fix/844-indexer-event-failure-counters

Conversation

@TCROWN10

Copy link
Copy Markdown

Summary

  • Maintain eventsProcessed / eventsFailed / lastErrorAt counters in SorobanEventWorker, with a sliding-window degraded signal when failure rate spikes (≥50% over 5 minutes with ≥3 samples).
  • Expose the counters on GET /v1/admin/metrics.indexer (live even on cache HIT) and GET /health, returning 503 when the indexer is enabled and degraded.
  • Add unit/integration coverage for the counters and degraded path. Also restores a broken sse.service.ts merge and removes a duplicate IndexerState model so Prisma/tests can run.

Closes #844

Test plan

  • vitest for soroban-event-worker, health, admin-metrics, sse.service
  • CI green on this PR
  • Manually confirm /health returns eventsFailed / indexerDegraded after forced processing failures

Count processed/failed indexer events in the Soroban worker and expose
them on /health and admin metrics so a broken indexer cannot look healthy
when lag stays low. Also restore a broken SSE merge and align Vitest
coverage peer deps so the suite can run.

Closes LabsCrypt#844

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[Infra] Indexer event-processing failures are only logged - no failed-event counter in /health or admin metrics

1 participant