File tree 1 file changed +9
-2
lines changed
packages/node/src/integrations 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -108,15 +108,22 @@ export class RequestData implements Integration {
108
108
addGlobalEventProcessor ( event => {
109
109
const hub = getCurrentHub ( ) ;
110
110
const self = hub . getIntegration ( RequestData ) ;
111
- const req = event . sdkProcessingMetadata && event . sdkProcessingMetadata . request ;
111
+
112
+ const { sdkProcessingMetadata = { } } = event ;
113
+ const req = sdkProcessingMetadata . request ;
112
114
113
115
// If the globally installed instance of this integration isn't associated with the current hub, `self` will be
114
116
// undefined
115
117
if ( ! self || ! req ) {
116
118
return event ;
117
119
}
118
120
119
- const addRequestDataOptions = convertReqDataIntegrationOptsToAddReqDataOpts ( this . _options ) ;
121
+ // The Express request handler takes a similar `include` option to that which can be passed to this integration.
122
+ // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express people to use this
123
+ // integration, so that all of this passing and conversion isn't necessary
124
+ const addRequestDataOptions =
125
+ sdkProcessingMetadata . requestDataOptionsFromExpressHandler ||
126
+ convertReqDataIntegrationOptsToAddReqDataOpts ( this . _options ) ;
120
127
121
128
const processedEvent = this . _addRequestData ( event , req , addRequestDataOptions ) ;
122
129
You can’t perform that action at this time.
0 commit comments