Skip to content

Commit 0dc5ea2

Browse files
fixes
1 parent 9a114bb commit 0dc5ea2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datadog_lambda/dsm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def _dsm_set_sns_context(event):
7070
if not sns_data:
7171
return ""
7272
arn = sns_data.get("TopicArn", "")
73-
# Trace data needed for sns payload size calculation
73+
context_json = _get_dsm_context_from_lambda(record)
7474
trace_data = base64.b64encode(
75-
json.dumps(_get_dsm_context_from_lambda(record)).encode("utf-8")
75+
json.dumps(context_json).encode("utf-8")
7676
).decode("utf-8")
7777
payload_size = calculate_sns_payload_size(record, trace_data)
78-
_dsm_set_context_helper(record, "sns", arn, payload_size)
78+
_dsm_set_context_helper("sns", arn, payload_size, context_json)
7979
except Exception as e:
8080
logger.error(format_err_with_traceback(e))
8181

0 commit comments

Comments
 (0)