You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the TODO says this is _likely_ not needed anymore since OTel correctly
wraps the handler in all cases (I never ran into any situation where it
didn't).
Also, when a user would use `Sentry.wrapHandler` manually, the detection
mechanism checking whether the handler was already wrapped by OTel would
not work anyway, since it that case OTel wraps it only *after* we did,
resulting in double spans.
Also also, removing this makes our lives easier for streaming, where
this resulted in some issues with overlapping spans.
'The `startTrace` option is deprecated and will be removed in a future major version. If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`.',
220
+
);
221
+
});
222
+
}
223
+
234
224
constoptions: WrapperOptions={
235
225
flushTimeout: 2000,
236
226
callbackWaitsForEmptyEventLoop: false,
237
227
captureTimeoutWarning: true,
238
228
timeoutWarningLimit: 500,
239
229
captureAllSettledReasons: false,
240
-
startTrace: true,
230
+
startTrace: true,// TODO(v11): Remove this option. Set to true here to satisfy the type, but has no effect.
241
231
...wrapOptions,
242
232
};
233
+
243
234
lettimeoutWarningTimer: NodeJS.Timeout;
244
235
245
236
// AWSLambda is like Express. It makes a distinction about handlers based on its last argument
@@ -293,7 +284,7 @@ export function wrapHandler<TEvent, TResult>(
@@ -314,60 +305,15 @@ export function wrapHandler<TEvent, TResult>(
314
305
throwe;
315
306
}finally{
316
307
clearTimeout(timeoutWarningTimer);
317
-
if(span?.isRecording()){
318
-
span.end();
319
-
}
320
308
awaitflush(options.flushTimeout).catch(e=>{
321
309
DEBUG_BUILD&&debug.error(e);
322
310
});
323
311
}
324
312
returnrv;
325
313
}
326
314
327
-
// Only start a trace and root span if the handler is not already wrapped by Otel instrumentation
328
-
// Otherwise, we create two root spans (one from otel, one from our wrapper).
329
-
// If Otel instrumentation didn't work or was filtered by users, we still want to trace the handler.
330
-
// TODO: Since bumping the OTEL Instrumentation, this is likely not needed anymore, we can possibly remove this (can be done whenever since it would be non-breaking)
0 commit comments