ref(node)!: Remove legacy incoming HTTP span hooks and default keepAlive to true - #23396
Open
RulaKhaled wants to merge 3 commits into
Open
ref(node)!: Remove legacy incoming HTTP span hooks and default keepAlive to true#23396RulaKhaled wants to merge 3 commits into
RulaKhaled wants to merge 3 commits into
Conversation
…ive to true Incoming request spans now only go through `onSpanCreated` / `incomingRequestSpanHook`. The HTTP transport reuses sockets by default now that Node 8 keepAlive leaks are out of support. Fixes #22260 Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Contributor
size-limit report 📦
|
CHANGELOG and root MIGRATION.md are maintained separately; the breaking-change write-up for this PR lives in docs/migration/v11-end-state.md.
RulaKhaled
commented
Aug 14, 2026
| const { [HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = getHttpClientSubscriptions(options); | ||
| // If it was previously subscribed, first unsubscribe it | ||
| // TODO(v11): We can likely remove this when we drop preload support | ||
| // Replace a previous subscription so a later call does not stack duplicate listeners. |
Collaborator
Author
There was a problem hiding this comment.
context: #22260 said this was likely removable once @sentry/node/preload went away, but instrumentHttpOutgoingRequests() is still public and can be called more than once (last call wins). subscribe() stacks, so without unsubscribing first a second call would duplicate outgoing spans/breadcrumbs
Collaborator
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 044bf40. Configure here.
RulaKhaled
marked this pull request as ready for review
August 14, 2026 12:20
RulaKhaled
requested review from
chargome,
isaacs,
mydea and
s1gr1d
and removed request for
a team
August 14, 2026 12:20
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.
Incoming
http.serverspans only useincomingRequestSpanHook/onSpanCreated.httpIntegration'sinstrumentation.*hooks no longer run for incoming requests; they still apply to outgoing. The Node HTTP transport now defaultskeepAlivetotrue.TODOs:
requestHook/responseHook/applyCustomAttributesOnSpan; keeponSpanCreated— done.instrumentHttpOutgoingRequests()is still public and can be called more than once;subscribe()stacks.keepAlivetotrue— done. The leak was Node 8 era, v11 requires 20.19.0+.Fixes #22260