Used Guzzle's handler stack and Promise interfaces to build a tracing middleware that creates client spans and injects trace headers. Verified correctness against a MockHandler, confirming span creation, header injection, and status capture without a real network call.
- What worked
- The handler-stack middleware pattern made it straightforward to wrap outbound requests, and MockHandler enabled clean verification without network access.