Skip to content

fix: Validate env vars, expose metrics, fix envelope error, pluggable rate limiter - #185

Merged
thewealthyplace merged 1 commit into
prism-explorer:mainfrom
ekenedilichukwunwafor-web:fix/issues-20-23-26-28
Oct 27, 2026
Merged

thewealthyplace merged 1 commit into
prism-explorer:mainfrom
ekenedilichukwunwafor-web:fix/issues-20-23-26-28

Conversation

@ekenedilichukwunwafor-web

Copy link
Copy Markdown
Contributor

Summary

  • Validate indexer environment variables at startup with clear error messages
  • Expose Prometheus metrics on the health port for indexer observability
  • Handle undecodable XDR envelopes in /api/tx/[hash] gracefully
  • Make rate limiter pluggable with Redis backend for multi-instance deployments

Closes #20
Closes #23
Closes #26
Closes #28

… rate limiter

- prism-explorer#20: Validate POLL_INTERVAL_MS and SOROBAN_RPC_URL at startup with
  requirePositiveInt/requireEnv helpers; process exits with a clear message
  naming the bad variable instead of silently using NaN or wrong network.

- prism-explorer#23: Add prom-client metrics (indexer_ledgers_processed_total,
  indexer_rows_written_total, indexer_ledger_lag, indexer_poll_errors_total)
  and serve them at GET /metrics on the health port alongside /healthz.

- prism-explorer#26: Wrap xdr.TransactionEnvelope.fromXDR in try/catch in
  frontend/src/app/api/tx/[hash]/route.ts; returns 200 with invocation and
  resources set to null when the envelope cannot be decoded.

- prism-explorer#28: Extract a RateLimitStore interface with a Redis-backed implementation
  (RedisRateLimitStore using ioredis + Lua INCR/EXPIRE). Add rateLimitAsync
  for the distributed path. Selected automatically via RATE_LIMIT_REDIS_URL;
  falls back to the existing in-memory store when unset.
@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown

@ekenedilichukwunwafor-web is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel.

A member of the Team first needs to authorize it.

@thewealthyplace
thewealthyplace merged commit 00798b6 into prism-explorer:main Oct 27, 2026
1 check failed
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