Skip to content

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

Merged
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
TCROWN10:fix/844-indexer-event-failure-counters
Jul 30, 2026
Merged

fix(backend): track indexer event failures in health and admin metrics#997
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
TCROWN10:fix/844-indexer-event-failure-counters

Conversation

@TCROWN10

Copy link
Copy Markdown
Contributor

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>
@TCROWN10
TCROWN10 force-pushed the fix/844-indexer-event-failure-counters branch from 78d240a to 1eaa449 Compare July 30, 2026 10:10
@ogazboiz
ogazboiz merged commit 6f7277f into LabsCrypt:main Jul 30, 2026
4 of 9 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.

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

2 participants