DataDog / datadog-lambda-python

The Datadog AWS Lambda Layer for Python
https://docs.datadoghq.com/integrations/amazon_lambda/#installing-and-using-the-datadog-layer
Apache License 2.0
88 stars 46 forks source link

'_LambdaDecorator' object has no attribute 'trigger_tags' #532

Closed CatalinAndrei-Flam closed 4 weeks ago

CatalinAndrei-Flam commented 4 weeks ago

Expected Behavior

Datadog should not throw errors, in previous version this did not happen. (extension_layer_version:64, python_layer_version:98)

Actual Behavior

Datadog throws errors because it cannot extract the tags from the event. In this case the incoming event is not a dictionary but a list of dictionaries that's generated by a dynamodb stream in an aws eventbridge pipe with batching enabling.

Steps to Reproduce the Problem

  1. Update extension_layer_version to 65 and python_layer_version to 99
  2. Create. eventbridge pipe with dynamodb stream to lambda and batching enabled .
  3. Trigger multiple changes in the dynamodb table with stream enabled which will generate a list of dicts as an input event for the lambda that's failing. Image

Specifications

Stacktrace

  [ERROR]   2024-10-30T07:48:05.533Z    faa1c31f-9cde-4738-ba9d-fd118ea51f8e    Error 'list' object has no attribute 'get'. Traceback: Traceback (most recent call last):
  File "./python/lib/python3.11/site-packages/datadog_lambda/wrapper.py", line 282, in _before
  File "./python/lib/python3.11/site-packages/datadog_lambda/tracing.py", line 414, in is_legacy_lambda_step_function
AttributeError: 'list' object has no attribute 'get'

and

[ERROR] 2024-10-30T07:48:05.323Z    aca884cf-00d7-4b80-8764-6883788465f2    Error '_LambdaDecorator' object has no attribute 'trigger_tags'. Traceback: Traceback (most recent call last):
  File "./python/lib/python3.11/site-packages/datadog_lambda/wrapper.py", line 331, in _after
AttributeError: '_LambdaDecorator' object has no attribute 'trigger_tags'
purple4reina commented 4 weeks ago

Thank you for reporting this. We are looking to get a fix out right away.

purple4reina commented 4 weeks ago

Hi @CatalinAndrei-Flam, we have a released layer v101 which contains a fix for this issue. Please test it out and let us know if there's anything else you need.