I am trying to instrument XRay tracing in the application with GO code. I am looking to pass the same trace ID across multiple lambda stages(2-3 supervisor lambdas invoking 2-3 worker lambdas one after the other) so that they will be visible in one single AWS XRay service map. Each lambda has access to S3 bucket,DynamoDB and PostgreSQL RDS instance for doing some operations. As of now each lambda stages have different trace IDs which are showing as independent diagrams(not connected) in the XRay service map when I have just tried enabling Xray tracing for the lambdas. Also need to see other AWS services mentioned above in the XRay service map. Any sample GO codes would be really appreciable.
For eg:
Req := &slambda.InvokeInput{
FunctionName: aws.String(endInfo.workerArn),
InvocationType: aws.String("RequestResponse"),
Payload: jsonData,
}
Above is a piece of code invoking worker lambdas from supervisor lambda handler.How can we pass the trace id or context from the first lambda to subsequent lambdas so that it will be picked up by AWS Xray automatically and shows the interlinked xray map of the entire application?