Skip to content

Commit 636b2a5

Browse files
authored
chore(aws): Update README.md (#17601)
1 parent 7b98893 commit 636b2a5

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

packages/aws-serverless/README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@
44
</a>
55
</p>
66

7-
# Official Sentry SDK for Serverless environments
7+
# Official Sentry SDK for AWS Lambda
88

99
## Links
1010

11-
- [Official SDK Docs](https://docs.sentry.io/)
11+
- [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/aws-lambda)
1212

1313
## General
1414

15-
This package is a wrapper around `@sentry/node`, with added functionality related to various Serverless solutions. All
15+
This package is a wrapper around `@sentry/node`, with added functionality related to AWS Lambda. All
1616
methods available in `@sentry/node` can be imported from `@sentry/aws-serverless`.
1717

18-
Currently supported environment:
19-
20-
### AWS Lambda
21-
2218
To use this SDK, call `Sentry.init(options)` at the very beginning of your JavaScript file.
2319

2420
```javascript
@@ -30,14 +26,14 @@ Sentry.init({
3026
});
3127

3228
// async (recommended)
33-
exports.handler = Sentry.wrapHandler(async (event, context) => {
29+
export const handler = async (event, context) => {
3430
throw new Error('oh, hello there!');
35-
});
31+
};
3632

3733
// sync
38-
exports.handler = Sentry.wrapHandler((event, context, callback) => {
34+
export const handler = (event, context, callback) => {
3935
throw new Error('oh, hello there!');
40-
});
36+
};
4137
```
4238

4339
If you also want to trace performance of all the incoming requests and also outgoing AWS service requests, just set the
@@ -46,21 +42,21 @@ If you also want to trace performance of all the incoming requests and also outg
4642
```javascript
4743
import * as Sentry from '@sentry/aws-serverless';
4844

49-
Sentry.AWSLambda.init({
45+
Sentry.init({
5046
dsn: '__DSN__',
5147
tracesSampleRate: 1.0,
5248
});
5349
```
5450

55-
#### Integrate Sentry using internal extension
51+
#### Integrate Sentry using the Sentry Lambda layer
5652

57-
Another and much simpler way to integrate Sentry to your AWS Lambda function is to add an official layer.
53+
Another much simpler way to integrate Sentry to your AWS Lambda function is to add the official layer.
5854

5955
1. Choose Layers -> Add Layer.
60-
2. Specify an ARN: `arn:aws:lambda:us-west-1:TODO:layer:TODO:VERSION`.
56+
2. Specify an ARN: `arn:aws:lambda:us-west-1:943013980633:layer:SentryNodeServerlessSDKv10:19`. Get the latest ARN from the [docs](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/install/layer).
6157
3. Go to Environment variables and add:
62-
- `NODE_OPTIONS`: `-r @sentry/aws-serverless/build/npm/cjs/awslambda-auto`.
58+
- `NODE_OPTIONS`: `--import @sentry/aws-serverless/awslambda-auto`.
6359
- `SENTRY_DSN`: `your dsn`.
6460
- `SENTRY_TRACES_SAMPLE_RATE`: a number between 0 and 1 representing the chance a transaction is sent to Sentry. For
6561
more information, see
66-
[docs](https://docs.sentry.io/platforms/node/guides/aws-lambda/configuration/options/#tracesSampleRate).
62+
[docs](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/configuration/options/#tracesSampleRate).

0 commit comments

Comments
 (0)