Skip to content

Conversation

msonnb
Copy link
Contributor

@msonnb msonnb commented Aug 4, 2025

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.

@msonnb msonnb requested review from andreiborza and mydea August 4, 2025 14:14
@msonnb msonnb self-assigned this Aug 4, 2025
Comment on lines 57 to 62
/**
* Automatically trace all handler invocations.
* You may want to disable this if you use express within Lambda.
* @default true
*/
startTrace: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline: This is a breaking change so we can't just remove it. Let's mark this field as deprecated and add a warning log when it's used.

*/
captureAllSettledReasons: boolean;
/**
* @deprecated This option has no effect since OpenTelemetry always traces the handler.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Let's also mention that this will be removed in a future major and also add a TODO(v11) comment above.

consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'The `startTrace` option is deprecated and has no effect since OpenTelemetry always traces the handler. If you want to disable tracing, set `SENTRY_TRACES_SAMPLE_RATE` to `0.0`.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Same as above

captureTimeoutWarning: true,
timeoutWarningLimit: 500,
captureAllSettledReasons: false,
startTrace: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: And also let's add a TODO comment here and mention that this has no effect now but is kept in here for typing reasons.

@msonnb msonnb force-pushed the ms/aws-remove-manual-tracing branch from 22643ef to 0be3063 Compare August 4, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants