Skip to content

Commit f4b33f0

Browse files
committed
lazy load samplers
1 parent 86248a5 commit f4b33f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_xray_sdk/core/recorder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from .models.default_dynamic_naming import DefaultDynamicNaming
1313
from .models.dummy_entities import DummySegment, DummySubsegment
1414
from .emitters.udp_emitter import UDPEmitter
15-
from .sampling.sampler import DefaultSampler
16-
from .sampling.local.sampler import LocalSampler
1715
from .streaming.default_streaming import DefaultStreaming
1816
from .context import Context
1917
from .daemon_config import DaemonConfig
@@ -58,10 +56,12 @@ def __init__(self):
5856
context = check_in_lambda()
5957
if context:
6058
# Special handling when running on AWS Lambda.
59+
from .sampling.local.sampler import LocalSampler
6160
self._context = context
6261
self.streaming_threshold = 0
6362
self._sampler = LocalSampler()
6463
else:
64+
from .sampling.sampler import DefaultSampler
6565
self._context = Context()
6666
self._sampler = DefaultSampler()
6767

0 commit comments

Comments
 (0)