ref(node)!: Remove legacy incoming HTTP span hooks and default keepAlive to true - #23396
Merged
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
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
isaacs
requested changes
Aug 18, 2026
isaacs
left a comment
Member
There was a problem hiding this comment.
This looks really good. I think there's some more clean-up that could potentially be done, but wouldn't block on that. The only real issue is that keepAlive can be potentially hazardous without a retry for serverless use cases.
| */ | ||
| trackIncomingRequestsAsSessions?: boolean; | ||
|
|
||
| /** |
Member
There was a problem hiding this comment.
low/cleanup: we can probably just remove the rest of these "deprecated: does nothing" options.
Collaborator
Author
There was a problem hiding this comment.
also handled in the stacked PR
…nsubscribe Keep-alive sockets can die while a serverless isolate is frozen; retry once when Node reports a reused socket reset. setupOnce is unique by name, so the diagnostics-channel unsubscribe is unused. Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Contributor
3 tasks
RulaKhaled
added a commit
that referenced
this pull request
Aug 20, 2026
`outgoingRequestHook`, `outgoingResponseHook` and `outgoingRequestApplyCustomAttributes` had no coverage after #23396 dropped the incoming `instrumentation.*` assertions without replacing the outgoing side. Each hook derives its attribute from the objects it is handed, so a hook wired to the wrong span, request or response fails rather than passing silently.
RulaKhaled
added a commit
that referenced
this pull request
Aug 20, 2026
`outgoingRequestHook`, `outgoingResponseHook` and `outgoingRequestApplyCustomAttributes` had no coverage after #23396 dropped the incoming `instrumentation.*` assertions without replacing the outgoing side. Each hook derives its attribute from the objects it is handed, so a hook wired to the wrong span, request or response fails rather than passing silently.
RulaKhaled
added a commit
that referenced
this pull request
Aug 25, 2026
`outgoingRequestHook`, `outgoingResponseHook` and `outgoingRequestApplyCustomAttributes` had no coverage after #23396 dropped the incoming `instrumentation.*` assertions without replacing the outgoing side. Each hook derives its attribute from the objects it is handed, so a hook wired to the wrong span, request or response fails rather than passing silently.
RulaKhaled
added a commit
that referenced
this pull request
Aug 25, 2026
`outgoingRequestHook`, `outgoingResponseHook` and `outgoingRequestApplyCustomAttributes` had no coverage after #23396 dropped the incoming `instrumentation.*` assertions without replacing the outgoing side. Each hook derives its attribute from the objects it is handed, so a hook wired to the wrong span, request or response fails rather than passing silently.
RulaKhaled
added a commit
that referenced
this pull request
Aug 25, 2026
`httpIntegration` now uses the same option names as `httpServerIntegration` / `httpServerSpansIntegration` and the other server SDKs. After #23396, incoming `instrumentation.*` hooks were already gone; this PR finishes the leftover public API: flatten outgoing `instrumentation` into first-class hooks, and drop the long aliases that only existed on `httpIntegration`. Fixes #22255 ### Why The public `httpIntegration` surface had long names (`trackIncomingRequestsAsSessions`, `maxIncomingRequestBodySize`, …) mapped 1:1 onto shorter names already used by the sub-integrations, Bun, Deno, and Cloudflare. Those aliases were leftover from the OTEL HttpInstrumentation era; they were never deprecated, and v11 is the point to collapse them rather than carry both. Incoming `instrumentation.{requestHook,responseHook,applyCustomAttributesOnSpan}` already all ran at span create after dropping OTEL, which is why #23396 collapsed them to `onSpanCreated`. Outgoing still has real request vs response timing, so those become `outgoingRequestHook` / `outgoingResponseHook` / `outgoingRequestApplyCustomAttributes` instead of staying nested. Nuxt's `httpIntegration` override is dropped with them. It flushed on every outgoing HTTP response, which is the wrong place: the serverless freeze happens at the end of the incoming request, and `patchEventHandler` already flushes there after the Nitro handler. On platforms without `waitUntil`, the old hook also started an extra 2s flush per outbound request. Nuxt also stops pre-resolving `defaultIntegrations`. That line only existed to filter out `Http` and splice the customized integration back in, so removing the override left it doing nothing but harm: it computed the list from the raw options, pinning integration selection before `initNode` resolves `SENTRY_TRACES_SAMPLE_RATE`. Anyone enabling tracing purely through the environment silently lost every performance integration, while the channel injection inside `initNode` was still gated on the resolved value. --------- Co-authored-by: Cursor Grok 4.6 <cursoragent@cursor.com>
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