Repository navigation
feat(node): Instrument HTTP/2 servers that use the compat API - #25992
Conversation
Node only publishes `http.server.request.start` for `node:http` servers, so requests to `node:http2` servers got no isolation scope, trace continuation, server span or session. This covers Fastify with `http2: true`, Hono with an HTTP/2 server, and srvx (Nitro v3) when TLS is set. On `http2.server.stream.start` (Node 22.17+ and 24.2+), the server integration now wraps the emit of `stream.session.server`, the same as for HTTP/1 servers. The compat API emits `'request'` from inside its `'stream'` listener, so the existing request pipeline runs unchanged. Servers that only use the raw `'stream'` API, such as gRPC servers, stay out of scope. The request data and span attributes now read the host from `:authority` when there is no `host` header, and drop HTTP/2 pseudo-headers. The server spans no longer read `statusMessage` on HTTP/2 responses, because Node prints an `UnsupportedWarning` for it.
size-limit report 📦Compared: 2ed5b1e (PR test merge using develop at 6a4315b) Against: 6a4315b (develop) · base run #66045 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 56 successful. See the run.
Successful checks
|
Each unordered expect now checks its own trace ID, so the envelopes can arrive in any order. The suite only runs on Node versions that publish the http2.server.stream channels, and the assertions use the @sentry/conventions constants.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4bff77e. Configure here.
supports() only compared Node major versions, so a suite could not require a feature that was backported in a minor release. nodeMin takes the first version with the feature on each release line.
| * lines, e.g. `['22.17.0', '24.2.0']`. A Node version must reach the entry of its own release | ||
| * line, or of the closest older one. | ||
| */ | ||
| nodeMin?: string[]; |
There was a problem hiding this comment.
hmm, do we need this, I wonder? do we not run tests on latest 22 and 24 versions respectively on ci already?
mydea
left a comment
There was a problem hiding this comment.
left one comment about the test runner change (can we live without it?) other than this great catch and lgtm!

Node only publishes
http.server.request.startfornode:httpservers, sonode:http2requests (Fastifyhttp2: true, Hono, srvx with TLS) got no isolation, trace continuation, spans or sessions. Onhttp2.server.stream.startwe now wrapstream.session.server's emit like for HTTP/1, and the compat API's'request'event runs through the existing pipeline. Raw'stream'API servers (gRPC) are out of scope.Unlike
http.server.request.start, the HTTP/2 channel message has noserver, so we read it fromstream.session.server. That getter exists onServerHttp2Sessionin Node 22 and 24 but is not in the Node docs. If Node removes it, the listener does nothing and HTTP/2 requests are untraced again, as today.