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
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
traceId(UUID v4)traceIdadded as an HTTP headerX-Trace-Idon every outgoing RPC requesttraceIdincluded in all telemetry hook payloads:onCallStart,onCallEnd,onErrortraceIdincluded in all error objects:error.traceIdsdk.getInvoice(id, { traceId: 'my-trace-123' })for correlation with app-level tracessdk.setDefaultTraceIdGenerator(fn)allows custom ID generation (e.g. OpenTelemetry span IDs)traceIdvisible in debug logs whenLoggingPluginis activetraceIdpropagation through the full call stack