Skip to content

test(e2e): Port SvelteKit E2E test apps to span streaming - #23936

Open
msonnb wants to merge 4 commits into
developfrom
ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming
Open

test(e2e): Port SvelteKit E2E test apps to span streaming#23936
msonnb wants to merge 4 commits into
developfrom
ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming

Conversation

@msonnb

@msonnb msonnb commented Sep 2, 2026

Copy link
Copy Markdown
Member

Ports sveltekit-2, sveltekit-2-kit-tracing, sveltekit-2-svelte-5, sveltekit-2.5.0-twp, sveltekit-3 and sveltekit-cloudflare-pages to span streaming, and adds sveltekit-2-static as a verbatim copy of the old sveltekit-2 (only the app name changed) to keep the static trace lifecycle covered.

Decisions taken while porting:

  • Under streaming the browser's pageload segment is parented to the server's sveltekit.resolve span, so the whole request shares one trace. The kit-tracing and SvelteKit 3 specs use a small getSegmentChildSpans helper that walks a segment's descendants without crossing into other segments, which keeps the exact child-span count assertions meaningful.
  • SvelteKit router spans are now named Router, browser fetch spans GET localhost, and mysql spans carry the query summary (SELECT) as name with the full text in db.query.text. Specs assert the new names and keep the old details as attributes.
  • On Cloudflare Pages the outermost segment is the @sentry/cloudflare request span (GET, source url); the SvelteKit GET /db-mysql span is its child. The db specs match on the trace instead of a transaction name.
  • The request assertions on server transactions have no streamed equivalent and became assertions on http.request.method and http.request.header.* attributes.
  • The skipped SvelteKit 3 form-action test stays skipped with its FIXME.

closes #23808

@linear-code

linear-code Bot commented Sep 2, 2026

Copy link
Copy Markdown

JS-3492

@msonnb
msonnb force-pushed the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch from 8c5d6d8 to 70d02ef Compare September 2, 2026 12:23
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.94 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.83 kB - -
@sentry/browser (incl. Tracing) 48.87 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.88 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.8 kB - -
@sentry/browser (incl. Tracing, Replay) 88.36 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.76 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.05 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.02 kB - -
@sentry/browser (incl. Feedback) 46.06 kB - -
@sentry/browser (incl. sendFeedback) 33.64 kB - -
@sentry/browser (incl. FeedbackAsync) 38.74 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.81 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.32 kB - -
@sentry/react (incl. Tracing) 51.08 kB - -
@sentry/vue 35.74 kB - -
@sentry/vue (incl. Tracing) 51.14 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.52 kB - -
CDN Bundle (incl. Logs, Metrics) 32.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.19 kB - -
CDN Bundle (incl. Tracing, Replay) 87 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.83 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.57 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.26 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.43 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.07 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.74 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.43 kB - -
@sentry/nextjs (client) 53.7 kB - -
@sentry/sveltekit (client) 49.3 kB - -
@sentry/core/server 40.74 kB - -
@sentry/core/browser 13.42 kB - -
@sentry/node 124.48 kB +0.02% +24 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB - -
@sentry/node - without tracing 88.3 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 103.77 kB +0.02% +18 B 🔺
@sentry/aws-serverless 96.66 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 200.81 kB - -
@sentry/cloudflare (withSentry) 499.76 kB - -

View base workflow run

@msonnb
msonnb marked this pull request as ready for review September 2, 2026 12:42
@msonnb
msonnb requested review from Lms24 and andreiborza September 2, 2026 12:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 70d02ef. Configure here.

Comment thread dev-packages/e2e-tests/test-applications/sveltekit-2-static/docker-compose.yml Outdated
'http.method': { value: 'GET', type: 'string' },
'http.request.method': { value: 'GET', type: 'string' },
'http.route': { value: '/server-load-fetch', type: 'string' },
'sveltekit.tracing.original_name': { value: 'sveltekit.handle.root', type: 'string' },

@Lms24 Lms24 Sep 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still needed a conventions entry. Added here: getsentry/sentry-conventions#611, along with a few other attributes also found in other tests

op: 'function',
description: 'sveltekit.resolve',
origin: 'auto.http.sveltekit',
name: 'sveltekit.resolve',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: do we collect a code.function.name attribute for this as well? We still need to create function span name and description rules and I think we basically want to infer names based on the function name, so this needs to land in an attribute in addition to the span name.

If we don't, this is out of scope and should be tackled via #23954

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope we just add op and origin for these

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for checking. Fine for now!

* `sveltekit.resolve` span and therefore shares the trace with the server request. Stopping at
* segment boundaries keeps assertions on the server request's child spans free of browser spans.
*/
export function getSegmentChildSpans(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good observation. Maybe we need some kind of helper that waits for an entire segment (across envelopes) but drops spans not belonging to the segment 🤔 This would avoid having to add this kind of function to meta framework e2e tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. do you think something like this c33c72d works? the assertions seem to pass fine (at least here in SvelteKit).

'sentry.origin': { value: 'auto.db.redis', type: 'string' },
'db.system.name': { value: 'redis', type: 'string' },
'db.operation.name': { value: 'set', type: 'string' },
'db.query.text': { value: 'set test-key [1 other arguments]', type: 'string' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heads-up: This PR needs a rebase and adjustments here because redis span names have changed via #23741

msonnb and others added 3 commits September 2, 2026 17:01
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch from cf27128 to 3179d93 Compare September 2, 2026 15:32
Replaces the per-app getSegmentChildSpans tree walk in the SvelteKit specs with a shared
collector that groups streamed spans by their segment id and resolves with the segment
span and its children.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch from 3179d93 to c33c72d Compare September 3, 2026 07:35
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.

Port SvelteKit E2E test apps to span streaming

2 participants