Skip to content

Commit 3f482eb

Browse files
fix
1 parent 1589c74 commit 3f482eb

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
@@ -68,7 +68,11 @@ def _dsm_set_sns_context(event):
6868
if not sns_data:
6969
return ""
7070
arn = sns_data.get("TopicArn", "")
71-
payload_size = calculate_sns_payload_size(record)
71+
# Trace data needed for sns payload size calculation
72+
trace_data = base64.b64encode(
73+
json.dumps(_get_dsm_context_from_lambda(record)).encode("utf-8")
74+
).decode("utf-8")
75+
payload_size = calculate_sns_payload_size(record, trace_data)
7276
_dsm_set_context_helper(record, "sns", arn, payload_size)
7377
except Exception as e:
7478
logger.error(format_err_with_traceback(e))

0 commit comments

Comments
 (0)