Skip to content

Add distributed-tracing correlation from HTTP requestId to Soroban txHash #496

Description

@josephchimebuka

Summary

Propagate requestId through services into Soroban logs/metrics and link txHash so a single client request can be traced across API → DB → chain → outbox.

Why this matters

Support and incident response currently require manual log grepping across disconnected identifiers.

Where to work

  • requestId middleware
  • src/services/soroban.service.ts
  • src/services/bet-audit.service.ts
  • outbox / winston logger fields

What to implement

  1. Thread requestId via AsyncLocalStorage or explicit ctx.
  2. Include requestId on Soroban log lines and audit events.
  3. Index/searchable field linking requestId ↔ txHash.
  4. Document how to trace a failed bet in ops docs.
  5. Tests assert correlation fields present.

Acceptance criteria

  • Bet/claim logs include requestId and txHash together.
  • Outbox events carry correlation ids.
  • Ops doc with example query.
  • Tests verify fields.

Done when

One request can be traced from HTTP to chain settlement.

Metadata

Field Value
Difficulty advanced
Complexity high
Good first contribution? no

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSGrantFox OSS campaignMaybe RewardedPotential reward for contributorsStellar WaveIssues in the Stellar wave programThird CampaignCampaign: Third CampaignarchitectureArchitecture and boundariesbackendBackend engineeringobservabilityMonitoring, metrics, and logging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions