Skip to content

Add SDK method call tracing with unique trace IDs #400

Description

@Kingsman-99

Overview

When debugging a chain of SDK calls, there is no way to correlate a specific RPC request in server logs with the SDK call that triggered it. Add trace IDs that flow through every request for end-to-end observability.

Acceptance Criteria

  • Each SDK method call generates a unique traceId (UUID v4)
  • traceId added as an HTTP header X-Trace-Id on every outgoing RPC request
  • traceId included in all telemetry hook payloads: onCallStart, onCallEnd, onError
  • traceId included in all error objects: error.traceId
  • Caller can supply their own: sdk.getInvoice(id, { traceId: 'my-trace-123' }) for correlation with app-level traces
  • sdk.setDefaultTraceIdGenerator(fn) allows custom ID generation (e.g. OpenTelemetry span IDs)
  • traceId visible in debug logs when LoggingPlugin is active
  • Unit tests verify traceId propagation through the full call stack

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highdxDeveloper experience and tooling

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