Skip to content

test(nuxt): Add baseline span tree E2E tests - #26885

Merged
s1gr1d merged 2 commits into
developfrom
sig/nuxt-e2e-baseline-span-asserts
Nov 26, 2026
Merged

s1gr1d merged 2 commits into
developfrom
sig/nuxt-e2e-baseline-span-asserts

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

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-4 and nuxt-5:

  • Exact span counts for server middleware, storage and cache, with no filter on name or origin.
  • Storage, cache and db spans are children of the request root.
  • A page that fails during SSR: one error event, and the root span has the error status.

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: true on nuxt-5, the count tests fail today, because middleware and cache spans come twice.

Two known bugs are marked with test.fail and get their own fixes: the root span of a failed SSR render has no page route (GET /__nuxt_error on Nuxt 4, else GET), and the Vite server captures no SSR error.

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.
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
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.

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.66 kB - -
@sentry/browser (incl. Tracing Core) 40.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.66 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.56 kB - -
@sentry/browser (incl. Tracing, Replay) 93.59 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.38 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.39 kB - -
@sentry/browser (incl. Feedback) 48.4 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.16 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.37 kB - -
@sentry/vue 38.74 kB - -
@sentry/vue (incl. Tracing) 56.67 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.22 kB - -
@sentry/effect (client, incl. Tracing) 54.96 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.31 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.38 kB - -
CDN Bundle (incl. Tracing) 54.04 kB - -
CDN Bundle (incl. Logs, Metrics) 35.13 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.5 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.08 kB - -
CDN Bundle (incl. Tracing, Replay) 91.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.31 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.78 kB - -
CDN Bundle - uncompressed 94.56 kB - -
CDN Bundle (incl. Tracing) - uncompressed 159.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.9 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.47 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 287.9 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 299.83 kB - -
@sentry/nextjs (client) 60.08 kB - -
@sentry/sveltekit (client) 55.02 kB - -
@sentry/core/server 45.83 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 157.38 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.79 kB - -
@sentry/node - without channel injection 146.35 kB -0.01% -2 B 🔽
@sentry/aws-serverless 100.42 kB +0.01% +2 B 🔺
@sentry/cloudflare (withSentry) - minified 211.94 kB - -
@sentry/cloudflare (withSentry) 491.72 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.88 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.18 kB - -

View base workflow run

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 6 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nuxt-5 (bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details

@s1gr1d s1gr1d changed the title test(nuxt): Add baseline span tree asserts to the E2E tests test(nuxt): Add baseline span tree E2E tests Nov 25, 2026
@s1gr1d
s1gr1d marked this pull request as ready for review November 26, 2026 09:08
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.
@s1gr1d
s1gr1d merged commit b47034c into develop Nov 26, 2026
67 checks passed
@s1gr1d
s1gr1d deleted the sig/nuxt-e2e-baseline-span-asserts branch November 26, 2026 10:42
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants