I have a web application (spring) which I want to instrument using AWS-XRay. I have added "AWSXRayServletFilter" in my web.xml, and the below snippet in my spring configuration class, as per documentation.
static {
AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard()
.withPlugin(new EC2Plugin()).withPlugin(new ECSPlugin());
builder.withSamplingStrategy(new DefaultSamplingStrategy());
AWSXRay.setGlobalRecorder(builder.build());
}
The below dependency is also added in pom.xml
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-xray-recorder-sdk-aws-sdk-instrumentor</artifactId>
<version>1.2.0</version>
</dependency>
During the application start up, I am getting the below exception.
com.amazonaws.xray.exceptions.SegmentNotFoundException: Failed to begin subsegment named 'AmazonDynamoDBv2': segment cannot be found
Any pointers to solve this will be helpful