Title: RequestData integration prework, work, and postwork · Issue #5756 · getsentry/sentry-javascript · GitHub
Open Graph Title: RequestData integration prework, work, and postwork · Issue #5756 · getsentry/sentry-javascript
X Title: RequestData integration prework, work, and postwork · Issue #5756 · getsentry/sentry-javascript
Description: There have gotten to be enough moving parts and dependencies involved in the RequestData integration work that I figured it's worth writing them all down. Background The underlying request-data-adding functions got moved from @sentry/nod...
Open Graph Description: There have gotten to be enough moving parts and dependencies involved in the RequestData integration work that I figured it's worth writing them all down. Background The underlying request-data-add...
X Description: There have gotten to be enough moving parts and dependencies involved in the RequestData integration work that I figured it's worth writing them all down. Background The underlying request-data...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/5756
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RequestData integration prework, work, and postwork","articleBody":"There have gotten to be enough moving parts and dependencies involved in the `RequestData` integration work that I figured it's worth writing them all down.\r\n\r\n### Background\r\n\r\n- The underlying request-data-adding functions got moved from `@sentry/node` to `@sentry/utils` in order to be able to use them in the `_error` helper in the nextjs SDK, which runs in both browser and node and therefore must be platform agnostic. (The function is only actually called in node, but has to be imported from a neutral source.) As a result of that change, node-specific dependencies needed for those functions were forced to be provided via dependency injection, by wrapper functions in the node SDK.\r\n- The new data-fetcher wrappers in the nextjs SDK needed a new way to use the functions. (We currently use them in scope-specific event processors, but the events those wrappers create pass through a number of different scopes, so that won't work for them.) To solve this, and to bring continuity to our use of the functions, we decided to create an integration.\r\n- There was a recent DACI wherein we decided that we eventually want to add the same data to events tracking fetch requests in the browser.\r\n\r\n### Problems/Constraints\r\n\r\n- The functions themselves are part of the Great Transaction Mess (see https://github.com/getsentry/sentry-javascript/issues/5718 and https://github.com/getsentry/sentry-javascript/issues/5660).\r\n- The dependency injection is kind of gross and hard to follow.\r\n- It's unclear how much overlap there'll be between the node and browser versions of the integration, and the browser version isn't yet roadmapped (and therefore we don't know how soon it will happen).\r\n- Because of the above two points, we decided to undo the move from node to utils, because once the integration is in use, the _error helper doesn't need to use the functions directly. Until it is, though, the helper still needs the function to live in the utils package.\r\n\r\n### Order of Operations\r\n\r\nImmediate term:\r\n\r\n- [x] Create polymorphic request type so request can be stored on transaction (https://github.com/getsentry/sentry-javascript/pull/5744)\r\n- [x] Move the functions back to the node package, but leave them also in utils for now (https://github.com/getsentry/sentry-javascript/pull/5759)\r\n- [x] Use integration for nextjs transactions (https://github.com/getsentry/sentry-javascript/pull/5703)\r\n- [x] Use integration for nextjs errors (https://github.com/getsentry/sentry-javascript/pull/5729)\r\n- [x] Make integration default for node-based SDKs (https://github.com/getsentry/sentry-javascript/pull/5980)\r\n- [x] Clean up integration (https://github.com/getsentry/sentry-javascript/pull/5979)\r\n- [x] Use integration for express transactions and errors (https://github.com/getsentry/sentry-javascript/pull/5990)\r\n- [x] Use integration for GCP wrapper (https://github.com/getsentry/sentry-javascript/pull/5991)\r\n- [x] Use integration for remix (https://github.com/getsentry/sentry-javascript/pull/6007)\r\n- [x] Document integration and options to control what data is attached (https://github.com/getsentry/sentry-docs/pull/5674)\r\n- [ ] Mark future removals as deprecated and label all related TODOs (see v8 section below)\r\n\r\nLonger term:\r\n\r\n- [ ] Clean up transaction mess\r\n- [ ] Move extra logic from integration to revamped request-data-adding functions\r\n- [ ] Once browser version of integration is needed, figure out if we want to factor out common functionality or just make a separate integration\r\n\r\nv8 Removals/Deprecations/Breaking Changes:\r\n\r\n_(WIP - may not be an exhaustive list)_\r\n\r\n- [ ] Remove `requestDataDeprecated.ts` (`parseRequest` and friends)\r\n- [ ] Remove tests testing `parseRequest`/`addRequestDataToEvent` compatibility\r\n- [ ] Remove utils copy of request data functions\r\n- [ ] Make express request handler no longer take request data options (users can use integration options)\r\n- [ ] Make CGP wrapper no longer take request data options (users can use integration options)\r\n- [ ] Remove helper functions converting between `parseRequest`, `addRequestDataToEvent`, and `RequestData` integration options\r\n","author":{"url":"https://github.com/lobsterkatie","@type":"Person","name":"lobsterkatie"},"datePublished":"2022-09-16T01:59:25Z","url":"https://github.com/getsentry/sentry-javascript/issues/5756"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:18a79327-535c-e43b-e882-84babd8a507c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C764:250A6C:3F244:52399:6B042FAE |
| html-safe-nonce | c88e39874f23f7c842814421c9948008e8e65cd5573c6efc58f6a6aa69ffd384 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzY0OjI1MEE2QzozRjI0NDo1MjM5OTo2QjA0MkZBRSIsInZpc2l0b3JfaWQiOiI2NzcyNTIzOTQ5OTA2NzM1MDIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ce6a516c30eebef17611e6fc6027fb3a8e9f59ff9c7e01f8bb3bb6375a162dcd |
| hovercard-subject-tag | issue:1375288382 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/5756/issue_layout |
| twitter:image | https://opengraph.githubassets.com/10a59c9919be6d1c4a320ddf627c20c99b82b47290de11156bdf0ced5e446a94/getsentry/sentry-javascript/issues/5756 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/10a59c9919be6d1c4a320ddf627c20c99b82b47290de11156bdf0ced5e446a94/getsentry/sentry-javascript/issues/5756 |
| og:image:alt | There have gotten to be enough moving parts and dependencies involved in the RequestData integration work that I figured it's worth writing them all down. Background The underlying request-data-add... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lobsterkatie |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width