How can I pass xray trace over eventbridge?

Viewed 943

I am using AWS lambda and eventbridge. One lambdaA sends event to eventbridge and another lambdaB receives this event and save it to database. What I'd like to do is to add xray trace data on this flow. I'd like to see the flow in the service map on xray console.

But I don't know how to pass the xray data over eventbridge. Is there a header I can put the trace id in?

1 Answers

In this architecture, you will be sending single event or there will be multiple events sending/receiving at a time and stored in a queue ? If you're sending single event and other lambda function is receiving that event you can actually trace this call flow using AWS X-Ray. I believe you might have to instrument those calls that you want to trace within lambda function. In the case of sending/receiving multiple events at a time, your use case might fall under this issue. (https://github.com/aws/aws-xray-sdk-node/issues/208)

Related