Currently, aws-xray-sdk-go only sets the context in the (*Request).HTTPRequest.ctx of an AWS SDK Go v1 call to a downstream service, which will extract the context that was set here. However, sometimes a downstream service would look inside (*Request).context in order to extract the context.
Issue #, if available:
Currently,
aws-xray-sdk-go
only sets the context in the(*Request).HTTPRequest.ctx
of an AWS SDK Go v1 call to a downstream service, which will extract the context that was set here. However, sometimes a downstream service would look inside(*Request).context
in order to extract the context.The solution is to set the context in both of these areas, which is also how
aws-sdk-go
generally sets the context. AWS SDK Go Lambda API InvokeWithContext ExampleDescription of changes:
This change is essentially:
Code flow Before:
Code flow After:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.