Conversation
…eam simulation Adds production visibility and two operational safety nets for the indexer and stream endpoints. Observability - Prometheus registry covering indexer progress, RPC failovers/circuit breaker, SSE connections and drops, DB pool/query timings, HTTP requests and Node process stats. - GET /metrics is fail-closed: unavailable in production unless a guard is configured, and when both METRICS_BEARER_TOKEN and METRICS_ALLOWED_CIDRS are set both must pass. It also bypasses the global rate limiter. - OpenTelemetry bootstrap with OTLP HTTP export, plus domain spans for indexer batches, RPC calls and dead-letter replay. Honours OTEL_SDK_DISABLED and degrades to no-op spans when no provider exists. - Importable Grafana dashboard and setup docs under backend/docs/observability/. Indexer dead-letter queue - New IndexerDeadLetterEvent model; events that fail processing are quarantined with their payload, error and attempt count instead of being dropped, so a contract bug or RPC outage no longer loses events. - Admin endpoints to list, replay, replay-all and discard entries, behind the existing router-wide requireAdmin guard. Stream simulation - POST /api/v1/streams/simulate assembles an unsigned transaction and runs it against Soroban simulateTransaction, returning fee estimates, resource usage and the decoded return value, with contract error codes decoded into typed ApiError responses. Fixes found while testing - withSpan re-ran the wrapped function on error, so any failing operation executed twice and its error was reported as success. The callback is now invoked exactly once and errors propagate to the caller. The tracer is also resolved per call instead of being pinned at module load, which matters when the SDK initialises after this module or is disabled. - Route normalisation used global regexes with .test(), so stateful lastIndex made UUID and long-hash route labels alternate between raw and normalised forms between requests. - Array route templates produced double-slash labels such as /v1//streams/:id. - The simulation placeholder account was not a valid Stellar address.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Related Issues
Closes #
Changes Made
Testing
Test Coverage
Test Steps
Breaking Changes
Breaking Changes:
Migration Guide:
Screenshots/Demo
Checklist
Additional Notes