use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.
the class CustomSegmentContextTest method setupAWSXRay.
@BeforeEach
void setupAWSXRay() {
Emitter blankEmitter = Mockito.mock(Emitter.class);
Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
LocalizedSamplingStrategy defaultSamplingStrategy = new LocalizedSamplingStrategy();
SegmentContextResolverChain chain = new SegmentContextResolverChain();
chain.addResolver(new GlobalMapSegmentContextResolver());
AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSegmentContextResolverChain(chain).withSamplingStrategy(defaultSamplingStrategy).build());
AWSXRay.clearTraceEntity();
}
use of com.amazonaws.xray.strategy.sampling.LocalizedSamplingStrategy in project aws-xray-sdk-java by aws.
the class LambdaSegmentContextTest method setupAWSXRay.
@BeforeEach
public void setupAWSXRay() {
Emitter blankEmitter = Mockito.mock(Emitter.class);
Mockito.doReturn(true).when(blankEmitter).sendSegment(Mockito.anyObject());
Mockito.doReturn(true).when(blankEmitter).sendSubsegment(Mockito.anyObject());
AWSXRay.setGlobalRecorder(AWSXRayRecorderBuilder.standard().withEmitter(blankEmitter).withSamplingStrategy(new LocalizedSamplingStrategy()).build());
AWSXRay.clearTraceEntity();
}
Aggregations