-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(aws): Update guides for v10 Lambda Layer and NPM package #14482
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 4.35kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
andreiborza
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.
Could you also please replace the ESM/CJS functions headings with ESM/CJS Lambda functions just to be a bit more specific?
| sidebar_order: 1 | ||
| --- | ||
|
|
||
| The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` manually. |
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.
| The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` manually. | |
| The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of installing `@sentry/aws-serverless` with a package manager manually. |
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.
This screenshot is very pixelated, could you please retake it?
| Set the following environment variables in your Lambda function configuration: | ||
|
|
||
| ```bash {tabTitle:CommonJS} | ||
| NODE_OPTIONS="-r @sentry/aws-serverless/awslambda-auto" |
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.
| NODE_OPTIONS="-r @sentry/aws-serverless/awslambda-auto" | |
| NODE_OPTIONS="--require @sentry/aws-serverless/awslambda-auto" |
|
|
||
|  | ||
|
|
||
| **For ESM functions only:** You'll also need to manually wrap your handler as shown below: |
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.
Maybe we can pack this into an <Alert level="info" title="For ESM functions">, wdyt?
| }); | ||
| ``` | ||
|
|
||
| It's important to add both, the `Sentry.init` call outside the handler function and the `Sentry.wrapHandler` wrapper around your function to automatically catch errors and performance data. |
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.
m: It's also important that the Sentry import and init are at the very top of the file and only then having other imports. I think we should also call that out.
| We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function. | ||
| If you need more control over the SDK setup, you can also [initialize the SDK in code](#option-b-manual-setup). | ||
|
|
||
| However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](../layer) instead. |
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.
| However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](../layer) instead. | |
| However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](../layer) instead. |
|
|
||
| Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. | ||
|
|
||
| <OnboardingOptionButtons options={["error-monitoring", "performance"]} /> |
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.
| <OnboardingOptionButtons options={["error-monitoring", "performance"]} /> | |
| <OnboardingOptionButtons options={["error-monitoring", "performance", "profiling"]} /> |
andreiborza
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.
Nice work!
|
|
||
| ### My Lambda function uses `import` | ||
|
|
||
| If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./install/esm-npm__v9.x). |
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.
Bug: Incorrect Relative Paths in MDX File
The index__v9.x.mdx file, located in the install/ directory, contains incorrect relative paths for its internal links. The paths install/layer__v9.x, install/cjs-npm__v9.x, and install/esm-npm__v9.x incorrectly include an extra install/ segment and should be layer__v9.x, cjs-npm__v9.x, and esm-npm__v9.x respectively.
Draft: Merge when JS v10 SDKs are released in GA
Introduces new unified docs for ESM and CJS versions of the Lambda layer and NPM package