5

Propagate AWS X-Ray tracing header to the Lambda from SQS, SNS and DynamoDB stre...

 2 years ago
source link: https://pawelgrzybek.com/propagate-aws-x-ray-tracing-header-to-the-lambda-from-sqs-sns-and-dynamodb-stream/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Propagate AWS X-Ray tracing header to the Lambda from SQS, SNS and DynamoDB stream

Published: 2021.10.25 | 1 minutes read

I faced a challenge where I wanted to propagate AWS X-Ray tracing X-Amzn-Trace-Id header from one Lambda through DynamoDB stream triggered by put operation up to another Lambda. The documentation doesn’t cover working with AWS X-Ray and DynamoDB, but I found the answer in the “Amazon SQS and AWS X-Ray” section that follows a very similar flow. If you’re facing a similar challenge in your project, I have bad news. This integration is currently impossible.

It is not currently possible to connect a trace passed into an SQS queue to the Lambda consuming it on the other end. This is because although the trace header is propagated in the SQS message, you cannot set it in the Lambda because segments in Lambda are immutable.

AWS X-Ray X-Amzn-Trace-Id tracing header flow with SQS, SNS and DynamoDB flow

If you expect a better level of traceability of your service, for now, the only option is to use a third party service.The Epsagon Service Map is what I used and it worked great for me, but I know that Datadog comes with a similar feature. Fingers crossed that AWS X-Ray will become more powerful in the future, as it would be nice to have a sufficient level of tracing and not to leave AWS world.

If you liked this article, you can buy me a coffee and share it on Twitter.

What'ya think?

Name:
Website (optional):
Twitter (optional):
GitHub (optional):
Comment:

👆 you can use Markdown here

Save my data for the next time I commentCopyright © 2021 Pawel Grzybek

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK