Skip to content

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

Closed
wants to merge 10 commits into from
Closed

Feat/node lambda docs #2204

wants to merge 10 commits into from

Conversation

ajjindal
Copy link
Contributor

@ajjindal ajjindal commented Sep 7, 2020

Latest Node AWS integration docs update

@ajjindal ajjindal requested a review from a team as a code owner September 7, 2020 20:28
@vercel
Copy link

vercel bot commented Sep 7, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sentry/sentry-docs/1iluvd09w/sentry.dev
✅ Preview: https://sentry-docs-git-feat-node-lambda-docs.sentry.dev

badsyntax and others added 6 commits September 8, 2020 23:27
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.
@vercel vercel bot temporarily deployed to Preview September 9, 2020 06:49 Inactive
@@ -4,6 +4,9 @@ redirect_from:
- /platforms/node/aws_lambda/
---

*Verify Version*
_(New in version 5.22.4 - Lambda integration is in Beta)_
Copy link
Contributor

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

Comment on lines +28 to +29
dsn:
"___PUBLIC_DSN___",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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:
Copy link
Contributor

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) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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:
Copy link
Contributor

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.

@HazAT
Copy link
Member

HazAT commented Oct 13, 2020

Outdated

@HazAT HazAT closed this Oct 13, 2020
@HazAT HazAT deleted the feat/node-lambda-docs branch October 13, 2020 08:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants