Skip to content
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

lambda-js: Add note about esbuild module exports #594

Merged
merged 4 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/docs/getting-started/lambda/lambda-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The AWS managed Lambda layer for ADOT JavaScript provides a plug and play user e

The Lambda layer supports Node.JS v14+ Lambda runtimes. For more information about supported JavaScript and Node.JS versions, see the [OpenTelemetry JavaScript documentation](https://github.com/open-telemetry/opentelemetry-js).

For *TypeScript users*, if you are using `esbuild` (either directly or through tools such as the AWS CDK), you *must* export your handler function through `module.exports` rather than with the `export` keyword! The AWS mananaged layer for ADOT JavaScript needs to hot-patch your handler at runtime, but can't because `esbuild` makes your handler immutable when using the `export` keyword.

### Add the ARN of the Lambda Layer

In this section, we consume the Lambda layer for use with Node.JS Lambda Functions. This includes a reduced version of the [AWS Distro for OpenTelemetry Collector (ADOT Collector)](https://github.com/aws-observability/aws-otel-collector), which runs as a Lambda extension.
Expand Down