-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement extension for AWS Lambda for automatic integration. #3041
Implement extension for AWS Lambda for automatic integration. #3041
Conversation
c11b984
to
ce52eb9
Compare
@marshall-lee - Thanks for this. Kamil's out until next week, but in the meantime, two things:
How would you handle the As for running a script on every release, that's controlled by this file. |
But even when not using |
ce52eb9
to
8ee89d2
Compare
Ah, got it. Thanks for the explanation. Never mind, then! :-) |
@HazAT could you take a look at this while Kamil is out? We are trying to get this out by end of the week. Thanks @lobsterkatie |
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.
Is this file empty on purpose?
packages/serverless/index.js
WRT publishing this, we need to upload this publically to our own AWS account to a specific layer?
8ee89d2
to
8704ec5
Compare
8704ec5
to
6c214f4
Compare
Yep. There's also a script for this called Note that it must be uploaded to every region user might want because layer region and lambda function region must match. |
@kamilogorek you can re-check, i removed all questionnable stuff. |
Closing because we merged a PR that implements this: #3165 |
This PR aims to improve the experience for users who want to integrate Sentry to their AWS Lambda functions.
For now, users have to upload
@sentry/serverless
package and its every dependency into anode_modules
directory of their lambda function. It's especially inconvenient for people who just write the code in the AWS Console and don't have any external dependencies but want to enable error tracking & tracing.Thanks to AWS, there Lambda Layers exist. We can bundle all the Sentry packages and distribute it as pluggable layer available by its ARN string. Added a layer to the lambda, one can then load the integration automatically when the lambda starts using a special environment variable
NODE_OPTIONS=-r @sentry/serverless/dist/auto
. Then,SENTRY_DSN
environment variable must be set too andSENTRY_TRACES_SAMPLE_RATE
is also available to enable tracing.TODO:
publish
script that pushes a zip bundle to every region of AWS (it creates a new version of a layer).Another problem I don't know what to do with is layer versions. Layers don't have anything like tags, e.g
@v5.27.3
. Layer versions are just auto-incrementing numbers, e.g.arn:aws:lambda:eu-central-1:123456789:layer:SentrySDK:1
,arn:aws:lambda:eu-central-1:123456789:layer:SentrySDK:2
, ...So we need to figure out a way how to inform users which version is the latest. Maybe the serverless
README.md
must be somehow updated every time a new layer version is uploaded? Or theREADME.md
should just contain a hyperlink to some page with the latest version numbers? I really don't know.