Skip to content

Commit 9a114bb

Browse files
fix
1 parent 634eb37 commit 9a114bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

datadog_lambda/dsm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ def _dsm_set_sns_context(event):
7070
if not sns_data:
7171
return ""
7272
arn = sns_data.get("TopicArn", "")
73-
payload_size = calculate_sns_payload_size(record)
73+
# Trace data needed for sns payload size calculation
74+
trace_data = base64.b64encode(
75+
json.dumps(_get_dsm_context_from_lambda(record)).encode("utf-8")
76+
).decode("utf-8")
77+
payload_size = calculate_sns_payload_size(record, trace_data)
7478
_dsm_set_context_helper(record, "sns", arn, payload_size)
7579
except Exception as e:
7680
logger.error(format_err_with_traceback(e))

0 commit comments

Comments
 (0)