Skip to content

Commit 5c38703

Browse files
authored
Merge pull request #431 from majanjua-amzn/patch-1
[Lambda] Fix logging to only happen inside lambda function
2 parents bf8f919 + 3582607 commit 5c38703

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws_xray_sdk/core/lambda_launcher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def put_subsegment(self, subsegment):
7272
current_entity = self.get_trace_entity()
7373

7474
if not self._is_subsegment(current_entity) and (getattr(current_entity, 'initializing', None) or isinstance(current_entity, DummySegment)):
75-
if global_sdk_config.sdk_enabled():
75+
if global_sdk_config.sdk_enabled() and not os.getenv(LAMBDA_TRACE_HEADER_KEY):
7676
log.warning("Subsegment %s discarded due to Lambda worker still initializing" % subsegment.name)
7777
return
7878

0 commit comments

Comments
 (0)