How can I pass xray trace over eventbridge?
Asked Answered
F

1

8

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?

F answered 29/7, 2020 at 0:27 Comment(3)
Have you tried patching the botocore using aws-xray-sdk-python?Propagandist
I'm considering adding a custom field to the details, but like you, feel like it's something I'd expect in the SDKs. As best I can tell, it is not natively supported. I can see that the EventBridge API is called (via the XRay Console), but the connection to the handling function is not created.Fertilizer
I would also like to see this feature and I'm searching for a solution.Stammer
L
0

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)

Lott answered 29/7, 2020 at 17:4 Comment(2)
How can I trace the single event call with AWS X-Ray? How should I pass the trace ID between the sender and receiver lambdas?F
Please give some code example for "instrument those calls that you want to trace"Stammer

© 2022 - 2024 — McMap. All rights reserved.