- Newest
- Most votes
- Most comments
Hi,
It seems like it could be possible, although bear with me as I'm not too familiar with Amazon MQ. If you are able to customize headers that are propagated for messages in MQ, then it should be possible. The process would be something like this:
You should be able to enable ALB to generate a trace header following this documentation: https://docs.aws.amazon.com/xray/latest/devguide/xray-services-elb.html
Next, you'll need to attach that X-Ray trace header to Amazon MQ messages so that service A and B will be part of the same trace. To learn more about the trace header see: https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader
So, a header will be passed into Service A from ALB, then service A can propagate the header over Amazon MQ to service B. You should instrument both services with the X-Ray SDK (available in 6 languages) to parse the trace header and create a segment for each service: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html
And you'll also need to set up the daemon in your ECS environments to send segments from your services to the X-Ray backend: https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-ecs.html
Hope this helps as a workaround!
Relevant content
- asked a year ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago