Repository navigation
test(nuxt): Add baseline span tree E2E tests - #26885
Merged
Merged
Conversation
Pin the span tree that the Nuxt SDK makes today, before the work on tracing channels starts: exact span counts for middleware, storage and cache spans with no filter on name or origin, the request root as the parent of storage, cache and db spans, and a page that fails during SSR. A second span from another source, or a changed parent, now fails a test. Two known bugs are marked with `test.fail`: the root span of a failed render has no page route, and the Vite server captures no SSR error.
Contributor
size-limit report 📦Compared: 76d2e6e (PR test merge using develop at e732d05) Against: e732d05 (develop) · base run #68089 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsAll optional checks were successful. 6 successful. See the run. Successful checks
|
s1gr1d
marked this pull request as ready for review
November 26, 2026 09:08
javascript-sdk-gitflow
Bot
requested review from
RulaKhaled,
chargome and
nicohrubec
November 26, 2026 09:08
chargome
approved these changes
Nov 26, 2026
s1gr1d
added a commit
that referenced
this pull request
Nov 26, 2026
## What Server error events from the Nitro error hook now treat the query string of the request like the rest of the SDK does: - The path in the `nuxt` context goes through `dataCollection.urlQueryParams`: `/api/user?include=profile&auth=[Filtered]`. - The transaction name has no query string: `GET /api/user`. - The transaction name applies only to the captured error. Before, the hook set it on the current scope, where it stayed for later events. ## Why On Nitro v2 (Nuxt 3 and 4), the request path has the query string. `request.url` and `request.query_string` were already filtered, but the `nuxt` context and the transaction name had the raw value, so a secret in the URL reached the event. The name on the current scope showed up on Deno, where a later request can inherit that scope: error events of other requests got the name of the failed request. This made `nuxt-4 (deno)` fail in #26885.
51 tasks done
s1gr1d
added a commit
that referenced
this pull request
Nov 27, 2026
…26928) ## What With Nuxt's `tracingChannel` option on (Nitro v3), each server middleware and each storage call now gets one span instead of two. The response also has no `Server-Timing` header. - `nitroIntegration` has a new option `middleware`. With `false`, it makes no span for h3 middleware. - `@sentry/nuxt` now uses `nitroIntegration({ middleware: false, storage: false, serverTiming: false })`. ## Why The Nuxt SDK has its own spans for server middleware and storage, and it sends the trace to the browser with `<meta>` tags. The default `nitroIntegration` made a second span from the Nitro channels for the same operation. We keep the SDK spans and not the channel spans, because Nitro v2 has no channels and the h3 channel does not tell which middleware ran. The `handler` span of the h3 channel stays, because the SDK has no span for it. With the channel on, it is the parent of the storage, cache and db spans. Follow-up of #26885.
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.
I am aware that Deno currently fails, that's probably an issue in the Deno runtime (2.8.2 to 2.9.8). Later requests start in the leaked context. Deno issue: denoland/deno#37184
What
More E2E asserts for the server span tree in
nuxt-4andnuxt-5:Why
We want to use Nuxt's tracing channels next. These asserts pin today's span tree first, so a duplicate span or a changed parent fails a test. For example, with
tracingChannel: trueonnuxt-5, the count tests fail today, because middleware and cache spans come twice.Two known bugs are marked with
test.failand get their own fixes: the root span of a failed SSR render has no page route (GET /__nuxt_erroron Nuxt 4, elseGET), and the Vite server captures no SSR error.