Slow cloud request/response tagging in Docker Lambda function with datadog-lambda

Offen
#633 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@joeyzhao2018 arbeitet bereits daran.

Seit 14.7.2025.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

Hi, not sure if this is the right place or it should rather go to ddtrace or somewhere else:

Reproduction repo with CDK: https://github.com/maxfriedrich/datadog-cloud-payload-tagging-repro

The cloud request/response payload tagging feature causes a big slowdown for us for any DynamoDB query, even when "disabled" with the environment variable value "$.*" (0.xx seconds to > 10 seconds query), with the following setup:

  • Docker Lambda based on the Lambda Python 3.11 (or 3.13) base image
  • Installing the Datadog Lambda extension into the container
  • Installing datadog-lambda and ddtrace with into the container
  • Running the function with datadog_lambda.handler

(this function outgrew the zip size limit, this is why it's built like this -- is this a supported setup?)

We can work around it by setting the environment variable values to "", fully disabling the feature, not just redacting all fields.

The problem only occurs with a Docker based Lambda function, the handler from my reproduction is fine in the Python runtime and the Datadog extension and Lambda layers.

Output from my test script:

Testing slow function: arn:aws:lambda:eu-central-1:...:function:DdTaggingReproStack-Function1904AA941-QLjJ2nwy96AV
Execution time: 11.545 seconds
Execution time: 10.865 seconds
Execution time: 11.279 seconds
Execution time: 11.604 seconds
Execution time: 11.659 seconds

Testing fast function: arn:aws:lambda:eu-central-1:...:function:DdTaggingReproStack-Function28EA0674A-36P7xO9x9CbG
Execution time: 0.235 seconds
Execution time: 0.188 seconds
Execution time: 0.168 seconds
Execution time: 0.194 seconds
Execution time: 0.206 seconds

Do you have any ideas what could cause this? Feel free to move the issue if it belongs somewhere else. Thank you very much!

Vorherrschende Sprache
Python
Sterne
102
Forks
52
Ø Merge
5 T. 19 Std.
Gemergte PRs (30 T.)
2

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DataDog/datadog-lambda-python

Alle Issues in DataDog/datadog-lambda-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.