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
gefragt vor 2 Jahren1328 Aufrufe
3 Antworten
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
beantwortet vor 2 Jahren
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
beantwortet vor 2 Jahren
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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen