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
已提问 2 年前1328 查看次数
3 回答
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
已回答 2 年前
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
已回答 2 年前
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
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则