I'm attempting to build a serverless application using AWS APIGateway/Lambda function integration.
I have the following setup:
* Two APIGateway resources. Calling them service A and service B for now.
* Two Lambda functions which act the the backend, responsible for processing the requests from APIGateway. Calling them LambdaFunction A and LambdaFunction B for now.
ServiceA -> LambdaFunctionA
ServiceB -> LambdaFunctionB
ServiceA->ServiceB
Now, as per the setup serviceA can call ServiceB. I would like to trace a request originating from serviceA to serviceB. One of the ways I was thinking to do this is through requestIds. I was attempting to see if there's some specific way to persist/explicitly provide requestIds when serviceA calls serviceB? I looked up AWS docs and couldn't find any specific mechanism on this.
The other alternative I had was to integration my Lambda functions with Xray and then maybe pass the requestId in the Xray context map/trace. I doubt I'm the first person attempting to trace requests across multiple Lambda functions and thought there would be a mechanism to do this already in place. Any help would be greatly appreciated!