Skip to content

Conversation

@joeyzhao2018
Copy link
Contributor

@joeyzhao2018 joeyzhao2018 commented Oct 21, 2025

What does this PR do?

Handle the case where the original handler code returns a side-effect artifact. Such as aws-serverless-express server.

Motivation

https://datadoghq.atlassian.net/browse/SLES-2468

Testing Guidelines

  1. Added Unittests
  2. Tested with a real lambda application

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@joeyzhao2018 joeyzhao2018 requested review from a team as code owners October 21, 2025 20:22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change might need to also be checked if needed in dd-trace-js integration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where in dd-trace-js?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That patching is safe. It's because it is yet another layer of wrapping above the patching done here in this repo.
My understanding is that this promisifiedHandler function exists in order to make it easier for the wrapping to add pre and post run handling, i.e., enabling it to use try { await the_promisifiedHandler} finally {}. And it just need to be done once. So dd-trace-js part should be good.

@joeyzhao2018 joeyzhao2018 merged commit a7aa142 into main Oct 23, 2025
26 checks passed
@joeyzhao2018 joeyzhao2018 deleted the joey/sles-2468 branch October 23, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants