chore(aws): Remove manual span creation#17310
Merged
Conversation
andreiborza
reviewed
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; |
Member
There was a problem hiding this comment.
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.
andreiborza
approved these changes
Aug 4, 2025
packages/aws-serverless/src/sdk.ts
Outdated
| */ | ||
| captureAllSettledReasons: boolean; | ||
| /** | ||
| * @deprecated This option has no effect since OpenTelemetry always traces the handler. |
Member
There was a problem hiding this comment.
l: Let's also mention that this will be removed in a future major and also add a TODO(v11) comment above.
packages/aws-serverless/src/sdk.ts
Outdated
| 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`.', |
packages/aws-serverless/src/sdk.ts
Outdated
| captureTimeoutWarning: true, | ||
| timeoutWarningLimit: 500, | ||
| captureAllSettledReasons: false, | ||
| startTrace: true, |
Member
There was a problem hiding this comment.
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.
andreiborza
approved these changes
Aug 4, 2025
22643ef to
0be3063
Compare
0be3063 to
bccae5f
Compare
This was referenced Sep 29, 2025
This was referenced Oct 7, 2025
This was referenced Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.wrapHandlermanually, 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.