Skip to content

Commit 268c1e5

Browse files
Keep APM records[0] approach
1 parent 6936bba commit 268c1e5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

datadog_lambda/tracing.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,16 @@ def extract_context_from_sqs_or_sns_event_or_context(
297297
if dd_json_data:
298298
dd_data = json.loads(dd_json_data)
299299

300-
if is_step_function_event(dd_data):
301-
try:
302-
return extract_context_from_step_functions(dd_data, None)
303-
except Exception:
304-
logger.debug(
305-
"Failed to extract Step Functions context from SQS/SNS event."
306-
)
307300
if idx == 0:
301+
if is_step_function_event(dd_data):
302+
try:
303+
return extract_context_from_step_functions(
304+
dd_data, None
305+
)
306+
except Exception:
307+
logger.debug(
308+
"Failed to extract Step Functions context from SQS/SNS event."
309+
)
308310
context = propagator.extract(dd_data)
309311
if not config.data_streams_enabled:
310312
break

0 commit comments

Comments
 (0)