Skip to content

feat(dsm): set context for sns->lambda #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: michael.zhao/lambda-support
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sqs support
  • Loading branch information
michael-zhao459 committed Jun 4, 2025
commit ff08143c99b7bf63c935b75ccf4c93db7bcf6e29
5 changes: 3 additions & 2 deletions datadog_lambda/dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def sns_payload_calculator(record, context_json):
return calculate_sns_payload_size(record, context_json)

def sns_arn_extractor(record):
sns_data = record.get("Sns", {})
sns_data = record.get("Sns")
if not sns_data:
return ""
return sns_data.get("TopicArn", "")

_dsm_set_context_helper(
Expand All @@ -69,5 +71,4 @@ def sqs_payload_calculator(record, context_json):

def sqs_arn_extractor(record):
return record.get("eventSourceARN", "")

_dsm_set_context_helper(event, "sqs", sqs_arn_extractor, sqs_payload_calculator)