Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2089fa9

Browse files
committedJun 17, 2025··
check datadog_attr is dict
1 parent ab8c871 commit 2089fa9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎datadog_lambda/dsm.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,18 @@ def _get_dsm_context_from_sqs_lambda(message):
5656
return None
5757

5858
datadog_attr = message_attributes["_datadog"]
59+
if not isinstance(datadog_attr, dict):
60+
logger.debug(
61+
"DataStreams did not handle lambda message, datadog context is not a dict, message: %r",
62+
message,
63+
)
64+
return None
5965

6066
if "stringValue" in datadog_attr:
6167
context_json = json.loads(datadog_attr["stringValue"])
6268
if not isinstance(context_json, dict):
6369
logger.debug(
64-
"DataStreams did not handle lambda message, context is not a dict, message: %r",
70+
"DataStreams did not handle lambda message, dsm context is not a dict, message: %r",
6571
message,
6672
)
6773
return None

0 commit comments

Comments
 (0)
Please sign in to comment.