-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Feat/node lambda docs #2204
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
Feat/node lambda docs #2204
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sentry/sentry-docs/1iluvd09w/sentry.dev |
Objective: We want to customize the sidebar of the OpenAPI docs and show something similar to the Stripe docs. If a user wants to exit the OpenAPI Reference then they can use the breadcrumbs navigation.
@@ -4,6 +4,9 @@ redirect_from: | |||
- /platforms/node/aws_lambda/ | |||
--- | |||
|
|||
*Verify Version* | |||
_(New in version 5.22.4 - Lambda integration is in Beta)_ |
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.
It'll be 5.23.0
dsn: | ||
"___PUBLIC_DSN___", |
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.
dsn: | |
"___PUBLIC_DSN___", | |
dsn: "___PUBLIC_DSN___" |
@@ -16,37 +19,60 @@ $ npm install --save @sentry/node | |||
$ yarn add @sentry/node | |||
``` | |||
|
|||
To set up Sentry error logging for a Lambda Function, build a wrapper: | |||
You can use the AWS Lambda integration for the Node SDK like this: |
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.
I'd remove the SDK
part from the Node SDK
"___PUBLIC_DSN___", | ||
}); | ||
|
||
const myAsyncHandler = async (event, context, callback) => { |
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.
const myAsyncHandler = async (event, context, callback) => { | |
const myAsyncHandler = async (event, context) => { |
async
functions are mutually exclusive with callback
. It's either async or sync with callback.
|
||
Sentry reports timeout warning when the function is within 500ms of it's execution time. You can turn off timeout warnings by setting `captureTimeoutWarning` to `false` during initiatlization. To change timeout warning limit, assign a numeric value (in ms) to `timeoutWarning`. |
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 is now how options are set for handlers.
Sentry.AWSLambda.wrapHandler(yourHandler, {
captureTimeoutWarning: false
});
So both, description and code examples are incorrect.
}); | ||
``` | ||
|
||
You can obtain the DSN using your Sentry account from your organization's _Settings > Projects > Client Keys (DSN)_ in the Sentry web UI. | ||
The timeout warning is sent only if the "timeout" in the Lambda Function configuration is set to a value greater than one second. |
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.
There's nothing stopping you from setting timeout to 1s
and still capture the warning if limit is small enough.
|
||
Create the deployment package in `.zip` format, then upload it to AWS Lambda as a Lambda Function. Checkout Sentry's [aws sample apps](https://github.com/getsentry/examples/tree/master/aws-lambda/node) for detailed examples. Refer to the [JavaScript docs](/platforms/javascript/) for more configuration options. | ||
- Sentry holds the thread for upto 2 seconds to report errors. You can change flush time limit by defining a `flushTimeout` value during initiatlization |
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.
in the handler options*
@@ -16,33 +17,43 @@ $ npm install --save @sentry/node | |||
$ yarn add @sentry/node | |||
``` | |||
|
|||
To set up Sentry error logging for a Lambda Function, build a wrapper: | |||
You can use the AWS Lambda integration for the Node SDK like this: |
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.
All the comments apply to this file as well, so I won't double-post them.
Outdated |
Latest Node AWS integration docs update