diff --git a/aws_xray_sdk/core/recorder.py b/aws_xray_sdk/core/recorder.py index 63ae1170..7f223e24 100644 --- a/aws_xray_sdk/core/recorder.py +++ b/aws_xray_sdk/core/recorder.py @@ -12,8 +12,6 @@ from .models.default_dynamic_naming import DefaultDynamicNaming from .models.dummy_entities import DummySegment, DummySubsegment from .emitters.udp_emitter import UDPEmitter -from .sampling.sampler import DefaultSampler -from .sampling.local.sampler import LocalSampler from .streaming.default_streaming import DefaultStreaming from .context import Context from .daemon_config import DaemonConfig @@ -58,10 +56,12 @@ def __init__(self): context = check_in_lambda() if context: # Special handling when running on AWS Lambda. + from .sampling.local.sampler import LocalSampler self._context = context self.streaming_threshold = 0 self._sampler = LocalSampler() else: + from .sampling.sampler import DefaultSampler self._context = Context() self._sampler = DefaultSampler()