diff --git a/aws_xray_sdk/core/lambda_launcher.py b/aws_xray_sdk/core/lambda_launcher.py index 55d782b4..ef6f8986 100644 --- a/aws_xray_sdk/core/lambda_launcher.py +++ b/aws_xray_sdk/core/lambda_launcher.py @@ -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