Expected Behavior
When return response from DynamoDB and DynamoDB contains data of type Decimal
Actual Behavior
Get data of DynamoDB that contains data of type Decimal and raise next exception except TypeError: 'decimal.Decimal' object is not iterable And the trace and log data is not sent complete.
Steps to Reproduce the Problem
- Get data from Dynamodb inside handler and return response.
In the code core de datadog_lambda in the line 37 raises of exception because Decimal is instance of object, but this is not iterable
if isinstance(obj, object):
for k in obj:
v = obj.get(k)
formatted_key = "{}.{}".format(key, k)
tag_object(span, formatted_key, v, depth)
return
Specifications
- Datadog Lambda Layer version:

Stacktrace
File "/opt/python/lib/python3.8/site-packages/datadog_lambda/wrapper.py", line 203, in _after
tag_object(self.span, "function.response", self.response)
File "/opt/python/lib/python3.8/site-packages/datadog_lambda/tag_object.py", line 40, in tag_object
tag_object(span, formatted_key, v, depth)
File "/opt/python/lib/python3.8/site-packages/datadog_lambda/tag_object.py", line 40, in tag_object
tag_object(span, formatted_key, v, depth)
File "/opt/python/lib/python3.8/site-packages/datadog_lambda/tag_object.py", line 40, in tag_object
tag_object(span, formatted_key, v, depth)
[Previous line repeated 4 more times]
File "/opt/python/lib/python3.8/site-packages/datadog_lambda/tag_object.py", line 37, in tag_object
for k in obj:
TypeError: 'decimal.Decimal' object is not iterable