powertools-lambda-typescript icon indicating copy to clipboard operation
powertools-lambda-typescript copied to clipboard

(tracer): Lambda -> SQS -> Lambda support

Open flochaz opened this issue 4 years ago • 0 comments

Description of the feature request

Problem statement

SQS currently don't propagate properly traces when chaining Lambda. See https://github.com/aws/aws-xray-sdk-node/issues/208 for more details.

Summary of the feature

  1. Implement a mechanism to detect when event coming from SQS and contains XRay trace id.
  2. Rebuild segments to be part of the main trace

Code examples

I did a first implem here : https://github.com/flochaz/x-ray-lambda-sqs-lambda/blob/main/lib/lambda/consumer-function/index.js

Benefits for you and the wider AWS community

The issue on xray sdk has been open for 2 years, people are getting really frustrated, 84 👍 and tens of comments ....

Describe alternatives you've considered

Wait for service team to fix it :)

flochaz avatar Dec 10 '21 08:12 flochaz