-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor Lambda Layer bundling #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Lambda Layer bundling #173
Conversation
jj22ee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
Can you list out which of these files are directly copied/modified from OTel's solution, and can you add images of the Trace map for both CJS and ESM Lambda handlers?
Description updated. I went back and removed the loader scripts since they weren't needed to instrument either handler. |
Issue #, if available:
Description of changes:
#171 introduced a bug where the Lambda server span was no longer produced in trace map for ESM-based handlers. This PR fixes the bug and now bundles the lambda layer directly instead of the autoinstrumentation package. The size of the bundled layer is now ~920KB, a nearly 94% reduction in size from the original 14.5MB.
The following files were copied from upstream to support Lambda layer bundling with minor changes:
webpack.config.js,tsconfig.webpack.json,tsconfig.esm.json, andinstall-externals.sh.Trace Map for CJS handler:

Trace Map for ESM handler:

Trace Map for ESM handler prior to fix (with bug):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.