Skip to content

Commit

Permalink
Merge pull request #431 from majanjua-amzn/patch-1
Browse files Browse the repository at this point in the history
[Lambda] Fix logging to only happen inside lambda function
  • Loading branch information
wangzlei authored May 15, 2024
2 parents bf8f919 + 3582607 commit 5c38703
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws_xray_sdk/core/lambda_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def put_subsegment(self, subsegment):
current_entity = self.get_trace_entity()

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

Expand Down

0 comments on commit 5c38703

Please sign in to comment.