It's been a while, but I think the above snippet i...
# general
j
It's been a while, but I think the above snippet is wrong in that the segment should be began at the beginning of the actual request, and ended at the end of the request. So the actual snippet should look like this:
Copy code
@Bean
    FilterRegistrationBean registerXRayFilter() {
        new FilterRegistrationBean(
                filter: new AWSXRayServletFilter(new DynamicSegmentNamingStrategy("MyApplication", '*.<http://example.com|example.com>')),
                order: Ordered.HIGHEST_PRECEDENCE
        )
    }
That creates the segments. The interceptor would call
AWSXray.beginSubsegment('MyInterceptor')
and
AWSXray.endSubsegment()
, and the AWS SDK does some "magic" (I think) to ensure the information is added to the segment created by the servlet filter.