From a16c6d80dc6b3fd009a2a1df4390c1e3cde20b64 Mon Sep 17 00:00:00 2001 From: Christopher Radek Date: Wed, 30 Jan 2019 15:28:42 -0800 Subject: [PATCH] fix(core): prevents CentralizedSamplingStrategy from instatiating extraneous recorders when no origin set --- .../xray/strategy/sampling/CentralizedSamplingStrategy.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/sampling/CentralizedSamplingStrategy.java b/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/sampling/CentralizedSamplingStrategy.java index 3e47db22..a0f9609f 100644 --- a/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/sampling/CentralizedSamplingStrategy.java +++ b/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/sampling/CentralizedSamplingStrategy.java @@ -60,10 +60,6 @@ public SamplingResponse shouldTrace(SamplingRequest samplingRequest) { logger.debug("Determining shouldTrace decision for:\n\tserviceName: " + samplingRequest.getService().orElse("") + "\n\thost: " + samplingRequest.getHost().orElse("") + "\n\tpath: " + samplingRequest.getUrl().orElse("") + "\n\tmethod: " + samplingRequest.getMethod().orElse("") + "\n\tserviceType: " + samplingRequest.getServiceType().orElse("")); } - if (!samplingRequest.getServiceType().isPresent()) { - samplingRequest.setServiceType(AWSXRayRecorderBuilder.defaultRecorder().getOrigin()); - } - if (manifest.isExpired(Instant.now())) { logger.debug("Centralized sampling data expired. Using fallback sampling strategy."); return fallback.shouldTrace(samplingRequest);