Hi Tom, I'm the original author of that component but I have to say that I'm no longer working for the team that initially experimented with it. Since then our technology stack furthermore changed and we ditched AWS XRay in our monitoring efforts completely. My current position also has hardly any use for Apache Camel, I am therefore not actively using it at the moment and most likely can't provide any updates. As Camel though is open source you can modify the code to your needs and provide a PR to the Camel. I'm sure the devs are welcoming any contributions that improve the codebase :)
AFAIR, XRay segments are thread-local in Java. In order to "copy over" a segment to the current thread the component supports a header property "XRAY_TRACE_ENTITY" which will put the given XRay (sub-)segment as trace entity in the global recorder. This way the segment should be "attached" to the local thread and reuse the existing XRay segment trace. I hope that this header property is what you are looking for and sorry for probably not being more helpful here. Kind regards, Roman On 09.05.2023 14:30, Tom Muldoon wrote:
Hi, We have recently begun efforts to adopt the camel-aws-xray library as part of a larger AWS Xray tracing strategy. Our application initiates an Xray Segment within a servlet filter before delegating to Camel which, in turn, sends an SQS message to a consumer. Ultimately, we would like a single trace to include the Segment created by the servlet filter and Subsegments thereafter created by camel-aws-xray (in both producer and consumer of SQS messages). With that said, camel-aws-xray and its XRayTracer class specifically does not seem to support use cases in which the application creates a Segment beforehand (as we encounter a SegmentNotFoundException when the servlet filter ultimately attempts to end the segment it created because camel-aws-xray overrode the segment with its own). Are we missing something? I feel like we must be. Thank you, Tom Tom Muldoon Senior Software Architect Copyright Clearance Center 222 Rosewood Drive Danvers, MA 01923 1.978.646.2796 tmuld...@copyright.com<mailto:tmuld...@copyright.com> www.copyright.com<http://www.copyright.com/> Facebook<http://www.facebook.com/CopyrightClear> * Twitter<http://twitter.com/CopyrightClear> * LinkedIn<http://www.linkedin.com/company/copyright-clearance-center> This message (including attachments) is confidential, unless marked otherwise. It is intended for the addressee(s) only. If you are not an intended recipient, please delete it without further distribution and reply to the sender that you have received the message in error.