Skip to content

Commit 499aa45

Browse files
committed
separate out the cross-execution case
1 parent 2aedd77 commit 499aa45

1 file changed

Lines changed: 1 addition & 33 deletions

File tree

datadog_lambda/tracing.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -568,35 +568,6 @@ def _extract_context_from_durable_checkpoint(operation):
568568
return propagator.extract(result)
569569

570570

571-
def _extract_context_from_durable_input_payload(operation):
572-
if not isinstance(operation, dict):
573-
return None
574-
575-
execution_details = operation.get("ExecutionDetails")
576-
if not isinstance(execution_details, dict):
577-
return None
578-
579-
input_payload = execution_details.get("InputPayload")
580-
if isinstance(input_payload, str):
581-
try:
582-
input_payload = json.loads(input_payload)
583-
except Exception:
584-
return None
585-
586-
if not isinstance(input_payload, dict):
587-
return None
588-
589-
headers = input_payload.get("headers")
590-
if isinstance(headers, dict):
591-
return propagator.extract(headers)
592-
593-
dd_data = input_payload.get("_datadog")
594-
if isinstance(dd_data, dict):
595-
return propagator.extract(dd_data)
596-
597-
return None
598-
599-
600571
def extract_context_from_durable_execution(event):
601572
operations = event.get("InitialExecutionState", {}).get("Operations")
602573
if isinstance(operations, dict):
@@ -621,10 +592,7 @@ def extract_context_from_durable_execution(event):
621592
highest = number
622593
best_operation = operation
623594

624-
if best_operation is not None:
625-
return _extract_context_from_durable_checkpoint(best_operation)
626-
627-
return _extract_context_from_durable_input_payload(operations[0])
595+
return _extract_context_from_durable_checkpoint(best_operation)
628596

629597

630598
def extract_context_custom_extractor(extractor, event, lambda_context):

0 commit comments

Comments
 (0)