Skip to content

Commit

Permalink
[Lambda] Fix logging to only happen inside lambda function
Browse files Browse the repository at this point in the history
  • Loading branch information
majanjua-amzn authored May 15, 2024
1 parent bf8f919 commit 3582607
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 3582607

Please sign in to comment.