René's URL Explorer Experiment


Title: [v8] Changes to serverless package · Issue #10976 · getsentry/sentry-javascript · GitHub

Open Graph Title: [v8] Changes to serverless package · Issue #10976 · getsentry/sentry-javascript

X Title: [v8] Changes to serverless package · Issue #10976 · getsentry/sentry-javascript

Description: In #10540 we explored refactoring the serverless package for v8, and we found some more structural issues that needed to be solved. This was further expanded with #10561. This is a brief proposal for the changes I think the serverless pa...

Open Graph Description: In #10540 we explored refactoring the serverless package for v8, and we found some more structural issues that needed to be solved. This was further expanded with #10561. This is a brief proposal f...

X Description: In #10540 we explored refactoring the serverless package for v8, and we found some more structural issues that needed to be solved. This was further expanded with #10561. This is a brief proposal f...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/10976

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v8] Changes to serverless package","articleBody":"In https://github.com/getsentry/sentry-javascript/pull/10540 we explored refactoring the `serverless` package for v8, and we found some more structural issues that needed to be solved. This was further expanded with https://github.com/getsentry/sentry-javascript/pull/10561.\n\nThis is a brief proposal for the changes I think the serverless package should take.\n\n# Current State\n\nRight now `@sentry/serverless`:\n\n1. re-exports everything from `@sentry/node` (aka `@sentry/node-experimental`) under main package exports\n\n```js\nimport { captureException } from '@sentry/serverless';\n```\n\n2. Exports 4 functions `init`, `getDefaultIntegrations`, `wrapHandler`, `tryPatchHandler` and re-exports all of `@sentry/node` under `AWSLambda` namespace\n\n```js\nimport { AWSLambda } from '@sentry/serverless';\n\nAWSLambda.init(...);\n\nAWSLambda.wrapHandler(...);\n\nAWSLambda.captureException(...);\n```\n\n3. Exports 5 functions `init`, `getDefaultIntegrations`, `wrapCloudEventHandler`, `wrapEventFunction`, `wrapHttpFunction` under the `GCPFunction` namespace\n\n```js\nimport { GCPFunction } from '@sentry/serverless';\n\nGCPFunction.init(...);\n\nGCPFunction.wrapCloudEventHandler(...);\n```\n\nThere is some logic in `awslambda-auto.ts` that is used for the lambda layer.\n\nThe main export also contains `awsServicesIntegration` export. There is a `googleCloudGrpcIntegration` and `googleCloudHttpIntegration` that exists in the package, but is not exported 😢.\n\n# Problem\n\n1. Namespace exports like `AWSLambda` and `GCPFunction` are not treeshakable, and bundle size really matters for serverless. This is not that bad for `GCPFunction`, but given `AWSLambda` re-exports all of the node sdk, that means anyone using `AWSLambda` and bundling pulls in the entire node sdk!\n2. It is very confusing to have three different `init` exported from the same package, each with their own behaviours (node init, aws init, gcp init)\n3. AWS and GCP code share nothing in common with each other (the utils file in serverless is only used by gcp related code), and the structure is confusing for maintainers.\n\n# Solution\n\nI propose we split `@sentry/serverless` into two packages, `@sentry/aws` and `@sentry/google-cloud`. This means we only export a single `init`, and for users the onboarding becomes way easier. In the future we can easily add support for `@sentry/azure` or similar! This makes sure we can optimize for that specific serverless package.\n\nWe have two options:\n\n1. Make the change in v7 and deprecate the `@sentry/serverless` package (easier upgrade path)\n2. Just split the packages up in v8 and make the breaking change for every serverless sdk user to switch to using either `@sentry/aws` or `@sentry/google-cloud` (lambda layer users will not be impacted in anyway.\n\nThe biggest change is to change package name, but we aren't breaking any of the top level exports so migration shouldn't be too bad. Lambda functions are also small, so I can't see it being too much work to go through people's codebase and change things.\n\n# Addendum \n\nIn https://github.com/getsentry/sentry-javascript/pull/10561 I explored using subpath exports as an alternative to new packages. I'm happier with the separate packages (more accurate download counts too!), but we can change the proposal if sentiments have changed.\n\n# Work\n\n```[tasklist]\n### Tasks\n- [x] https://github.com/getsentry/sentry-javascript/pull/10993\n- [x] remove all google cloud logic from `@sentry/serverless`\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11052\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11065\n- [ ] https://github.com/getsentry/sentry-javascript/issues/11066\n- [x] Update the path for the env var that Sentry sets in peoples lambdas https://github.com/getsentry/sentry/blob/b5f2368068033e3a32b049cba4ff2d7f20612f48/src/sentry/integrations/aws_lambda/utils.py#L242\n- [ ] https://github.com/getsentry/sentry/pull/70137\n```\n```[tasklist]\n### After Release\n- [ ] Remove deprecated lambda container image code - https://docs.sentry.io/platforms/node/guides/aws-lambda/container-image/\n```","author":{"url":"https://github.com/AbhiPrasad","@type":"Person","name":"AbhiPrasad"},"datePublished":"2024-03-08T04:40:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/10976"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:75a95fb6-5908-b0ce-fb60-1a3636bcb057
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D8C:1FAF:9E2302:D07992:6B03F4B1
html-safe-nonced31d34be458c1356711b7a2bca6e034ad73409e76cffd26adf223aac3c8808a9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDhDOjFGQUY6OUUyMzAyOkQwNzk5Mjo2QjAzRjRCMSIsInZpc2l0b3JfaWQiOiI4NjI2NTg0NTc2MjI5MzczMTA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace7c150218d43f174f6fe5b545abaf52bf7cad1dfeeba1a059aa633e2120ad535
hovercard-subject-tagissue:2175267575
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/10976/issue_layout
twitter:imagehttps://opengraph.githubassets.com/382c67d76cb5322efd6ce3b8d0788e8505ca9cab70ae288cfdce285a3b1bf1db/getsentry/sentry-javascript/issues/10976
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/382c67d76cb5322efd6ce3b8d0788e8505ca9cab70ae288cfdce285a3b1bf1db/getsentry/sentry-javascript/issues/10976
og:image:altIn #10540 we explored refactoring the serverless package for v8, and we found some more structural issues that needed to be solved. This was further expanded with #10561. This is a brief proposal f...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAbhiPrasad
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/10976#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F10976
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F10976
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/10976
Reloadhttps://github.com/getsentry/sentry-javascript/issues/10976
Reloadhttps://github.com/getsentry/sentry-javascript/issues/10976
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues345 (345)https://github.com/getsentry/sentry-javascript/issues
Pull requests76 (76)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/10976
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/10976
[v8] Changes to serverless packagehttps://github.com/getsentry/sentry-javascript/issues/10976#top
Feature: Serverlesshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Feature%3A%20Serverless%22
8.0.0https://github.com/getsentry/sentry-javascript/milestone/15
https://github.com/AbhiPrasad
AbhiPrasadhttps://github.com/AbhiPrasad
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issue-2175267575
#10540https://github.com/getsentry/sentry-javascript/pull/10540
#10561https://github.com/getsentry/sentry-javascript/pull/10561
#10561https://github.com/getsentry/sentry-javascript/pull/10561
AbhiPrasadhttps://github.com/AbhiPrasad
Feature: Serverlesshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Feature%3A%20Serverless%22
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#event-12051013963
AbhiPrasadhttps://github.com/AbhiPrasad
8.0.0https://github.com/getsentry/sentry-javascript/milestone/15
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#event-12051013967
https://github.com/mydea
mydeahttps://github.com/mydea
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985381548
https://github.com/Lms24
Lms24https://github.com/Lms24
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985544455
https://github.com/lforst
lforsthttps://github.com/lforst
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985588451
@mydeahttps://github.com/mydea
@Lms24https://github.com/Lms24
https://github.com/mydea
mydeahttps://github.com/mydea
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985672899
https://github.com/Lms24
Lms24https://github.com/Lms24
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985702086
https://github.com/AbhiPrasad
AbhiPrasadhttps://github.com/AbhiPrasad
on Mar 8, 2024https://github.com/getsentry/sentry-javascript/issues/10976#issuecomment-1985949284
mydeahttps://github.com/mydea
on Mar 13, 2024https://github.com/getsentry/sentry-javascript/issues/10976#event-12099888412
feat(v8): Rename gcp package to `@sentry/google-cloud-serverless` (#1…https://github.com/getsentry/sentry-javascript/commit/6027caad7c6f5ef64b6858806cf1275f1b5adc87
#1…https://github.com/getsentry/sentry-javascript/pull/11065
6027caahttps://github.com/getsentry/sentry-javascript/commit/6027caad7c6f5ef64b6858806cf1275f1b5adc87
AbhiPrasadhttps://github.com/AbhiPrasad
Platform: Google Cloud Functionshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Google%20Cloud%20Functions%22
Platform: AWS Lambdahttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Platform%3A%20AWS%20Lambda%22
on Apr 24, 2024https://github.com/getsentry/sentry-javascript/issues/10976#event-12594558160
AbhiPrasadhttps://github.com/AbhiPrasad
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 27, 2024https://github.com/getsentry/sentry-javascript/issues/10976#event-12946111645
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/10976
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/10976
Feature: Serverlesshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Feature%3A%20Serverless%22
8.0.0https://github.com/getsentry/sentry-javascript/milestone/15
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.