Repository navigation
feat(nitro): Mark the Nitro dev server from the plugins' Nitro hook - #26810
sentry-junior[bot] wants to merge 4 commits into
Conversation
size-limit report 📦Compared: e789bca (PR test merge using develop at 07fb3ab) Against: cee40e6 (develop) · base run #67873
|
|
One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check. |
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 81 successful. See the run.
Successful checks
|
9379b83 to
42879ea
Compare
…tructor The orchestrion path now marks Nitro's dev server process when it creates its `NitroDevApp`, so a `@sentry/node`-only app no longer sends a second `http.server` span from the dev server. The flag lives on the global object in `@sentry/server-utils`, and `@sentry/nitro` sets the same one. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
Importing it from `@sentry/server-utils` into `@sentry/node`'s HTTP integration added about 1 kB to the gzipped `@sentry/node` bundle. From `@sentry/core/server`, which the integration already imports, it adds about 200 bytes.
42879ea to
c04e306
Compare
Merges the updated base branch, which turns on Nitro's tracing channels from the Vite and Rollup plugins. The same hook now marks the dev server, so the orchestrion target on the `NitroDevApp` constructor and the `prepareResponse` dev-server check go away. Listing `nitro` for `nitroIntegration` moves to the PR that adds the first `nitro` target. Co-Authored-By: Francesco Gringl-Novy <2411343+mydea@users.noreply.github.com>
NitroDevApp constructor| * Marks this process as Nitro's dev server, which passes each request on to a worker that runs Nitro and | ||
| * traces the request. | ||
| */ | ||
| export function setIsNitroDevServer(): void { |
There was a problem hiding this comment.
this should be in server-utils instead of core
|
Closing this. With the setup we now recommend for Nitro ( |
What
With only
@sentry/nodeand its Vite or Rollup plugin, Nitro's dev server (fornitro devand Vite's dev server) no longer sends its ownhttp.serverspan for requests it passes on to Nitro's worker.@sentry/nitronow sets the same dev-server flag instead of its own copy, and drops its customhttpIntegration.Why
Part of #24900. Stacked on #26809.
The plugins' Nitro hook from #26809 runs in the dev server's process, so it marks the dev server there, unless the
selfrunner runs Nitro in that process. That needs no orchestrion target in Nitro's build chunks. The flag lives on the global object, set through@sentry/core/server, because the plugin,@sentry/nitro's module and the--imported SDK can each load their own copy of the SDK packages. Importing it from@sentry/server-utilsinto@sentry/node's HTTP integration cost about 1 kB gzipped;@sentry/core/server, which that integration already imports, costs about 200 bytes.@sentry/node'shttpIntegrationchecks the flag per request, next to the existing tracing-suppression check in its incoming-request span filter. The dev server is marked afterinit(), so a check at setup time would miss it. It also covers a user-providedhttpIntegration, which the old@sentry/nitrooverride replaced. Only spans are skipped, the same asignoreIncomingRequestsdid before.via @mydea.
--
View Session [Sentry]