-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
RequestData integration prework, work, and postwork #5756
Comments
As part of the work adding a `RequestData` integration, this moves the `requestdata` functions back into the node SDK. (The dependency injection makes things hard to follow, and soon the original reason for the move (so that they could be used in the `_error` helper in the nextjs SDK, which runs in both browser and node) will no longer apply (once #5729 is merged).) Once these functions are no longer needed, they can be deleted from `@sentry/utils`. More details and a work plan are in #5756.
@lobsterkatie , looking at this ticket, can you please clarify what is the impact on the user here? |
This is partially background work (standardizing our approach generally makes maintenance and expansion to other frameworks easier) and partially in order to bring our express integration's ability to, for example, not send cookies data to all packages where we attach request data to an event. (See this issue, for example: #4723.) |
This switches the request, tracing, and error handlers from the Node SDK's `handlers.ts` to use the new `RequestData` integration for adding request data to events rather than the current event processor. Notes: - So that this isn't a breaking change, for the moment (read: until v8) the integration will use the options passed to the request handler in place of its own options. (The request handler now stores its options in `sdkProcessingMetadata` alongside the request so that the integration will have access to them.) - Before this change, the event processor was backwards-compatible by dint of calling `parseRequest` rather than `addRequestDataToEvent` if the request handler's options are given in the old format. Because the integration uses only `addRequestDataToEvent` under the hood, the backwards compatibility is now achieved by converting the old-style options into equivalent new-style options, using a new helper function `convertReqHandlerOptsToAddReqDataOpts`. (And yes, that function name is definitely a mouthful, but fortunately only one will has to last until v8.) - Though in theory one should never use the error or tracing middleware without also using the request middleware, people do all sorts of weird things. All three middlewares therefore add the request to `sdkProcessingMetadata`, even though just doing so in the request handler should technically be sufficient. Ref: #5756
This switches the GCP wrapper in the serverless SDK to use the new `RequestData` integration for adding request data to events rather than the current event processor. Ref: #5756
Closing for now - we might reconsider this in the future |
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
@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.Problems/Constraints
transaction
value #5718 and Problematic API:Scope.setTransactionName()
#5660).Order of Operations
Immediate term:
PolymorphicRequest
type #5744)@sentry/node
#5759)RequestData
integration for errors #5729)RequestData
integration default #5980)RequestData
integration tweaks #5979)RequestData
integration in express handlers #5990)RequestData
integration in GCP wrapper #5991)RequestData
integration for server-side requests #6007)RequestData
integration sentry-docs#5674)Longer term:
v8 Removals/Deprecations/Breaking Changes:
(WIP - may not be an exhaustive list)
requestDataDeprecated.ts
(parseRequest
and friends)parseRequest
/addRequestDataToEvent
compatibilityparseRequest
,addRequestDataToEvent
, andRequestData
integration optionsThe text was updated successfully, but these errors were encountered: