How to correlate freight API calls with W3C Trace Context
Use a trace identifier to follow a technical request across participating services. Keep a separate business correlation reference for the booking or shipment and an independent key for operations that must not run twice.
A trace is diagnostic context, not a business record.
The W3C Trace Context recommendation defines HTTP headers such as traceparent for propagating trace context. Decide where to accept or regenerate context at trust boundaries, and do not place shipment data or credentials in tracing headers. Store a safe association between traces and authorised support records where needed.
A retry has a new trace but refers to the same booking operation.
A synthetic carrier request times out. A later authorised retry is logged under a different trace, but both attempts relate to one business operation. Correlate them without treating the new trace as permission to create another booking. Check the partner’s actual outcome before deciding what happened.
Validate trace continuity without changing business state.
- Test invalid or missing incoming context according to the agreed boundary policy.
- Check that async processing preserves a safe support correlation even when trace sampling omits spans.
- Verify that a complete trace does not by itself mark a freight operation accepted.