Skip to content

[Backend] Background indexer/worker logs carry no correlation id - only HTTP requests get one #845

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

logger.ts:4-18 injects requestId into log lines only from the AsyncLocalStorage store set on HTTP requests. The Soroban worker and indexerService run outside any requestContext, so a poll batch and its per-event errors share no traceable id - you cannot correlate failures belonging to one poll cycle or a specific admin replay.

Acceptance criteria

  • Wrap each poll/replay batch in requestContext.run({ requestId: }, ...) so all worker logs for one cycle share an id
  • Include the batch/correlation id in indexer error logs and in the replay endpoint response
  • Document the field in the logging section

Files to touch

  • backend/src/workers/soroban-event-worker.ts
  • backend/src/logger.ts
  • backend/src/services/indexerService.ts

Out of scope

  • Changing the log transport/format library

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend related tasksdevopsInfrastructure and CI/CDenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions