Make single AWS XRay Trace Id by propagating it end to end

0

I have use-case where the Producer Java lambda publishes file messages to SQS and Consumer Nodejs consumes them. Producer side of X-ray is enabled in serverless.yml; displays a Service map with all AWS components with a new Trace Id. The Consumer side of Nodejs lambda; is enabled with another Trace Id. I see a single service map, but with two clients. I guess it is because of the 2 separate Trace Ids. Is it possible to make single Trace Id by propagating it end to end?

Ashruf
asked 2 years ago1241 views
3 Answers
1

Hi, it is not possible at the moment. If you are using SQS than Lambda can get more than one Message per invocation. Each Messages has it´s own TracId associated and so it is not possible to assign on single traceId to the receiver Lambda.

AWS
Marco
answered 2 years ago
0

Thanks for asking this question. Unfortunately this is not yet supported. Please see this open issue on the X-Ray Node JS SDK which explains why this is a difficult problem to solve:

https://github.com/aws/aws-xray-sdk-node/issues/208

AWS
answered 2 years ago
0

The Producer side sends the messages to SQS using sqs.sendMessageBatch(new SendMessageBatchRequest(queueUrl)). The SQS can be seen in the Service graph, with its Trace Id.

The Consumer side is consuming messages from SQS. Yet the service graph does not show SQS with its Trace Id.

Is there a way/workaround to show SQS on the Consumer side of Trace?

Ashruf
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions