Skip to content

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

Merged
msonnb merged 4 commits into
developfrom
ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming
Sep 4, 2026
Merged

test(e2e): Port SvelteKit E2E test apps to span streaming#23936
msonnb merged 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.69 kB added added
@sentry/browser - with treeshaking flags 26.99 kB added added
@sentry/browser - with treeshaking flags tracing without tracing 26.89 kB added added
@sentry/browser (incl. Tracing) 49.07 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.07 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.98 kB added added
@sentry/browser (incl. Tracing, Replay) 88.62 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.85 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 93.3 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 106.24 kB added added
@sentry/browser (incl. Feedback) 46.17 kB added added
@sentry/browser (incl. sendFeedback) 33.75 kB added added
@sentry/browser (incl. FeedbackAsync) 38.85 kB added added
@sentry/browser (incl. Metrics) 29.66 kB added added
@sentry/browser (incl. Logs) 29.94 kB added added
@sentry/browser (incl. Metrics & Logs) 30.59 kB added added
@sentry/react 30.45 kB added added
@sentry/react (incl. Tracing) 51.28 kB added added
@sentry/vue 35.91 kB added added
@sentry/vue (incl. Tracing) 51.34 kB added added
@sentry/svelte 28.71 kB added added
CDN Bundle 30.43 kB added added
CDN Bundle (incl. Tracing) 49.6 kB added added
CDN Bundle (incl. Logs, Metrics) 32.66 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 51.53 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 73.31 kB added added
CDN Bundle (incl. Tracing, Replay) 87.15 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.02 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 93.08 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.03 kB added added
CDN Bundle - uncompressed 90.13 kB added added
CDN Bundle (incl. Tracing) - uncompressed 147.81 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.52 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.59 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.82 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.44 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.21 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.15 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.9 kB added added
@sentry/nextjs (client) 53.89 kB added added
@sentry/sveltekit (client) 49.51 kB added added
@sentry/core/server 40.96 kB added added
@sentry/core/browser 13.53 kB added added
@sentry/node 124.76 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB added added
@sentry/node - without tracing 88.5 kB added added
@sentry/node - without channel injection 104.08 kB added added
@sentry/aws-serverless 96.87 kB added added
@sentry/cloudflare (withSentry) - minified 201.56 kB added added
@sentry/cloudflare (withSentry) 501.37 kB added added

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).

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.

nevermind, using the one from #24073 now 👍

'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
msonnb force-pushed the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch 2 times, most recently from 3179d93 to c33c72d Compare September 3, 2026 07:35
msonnb and others added 3 commits September 4, 2026 13:59
Co-Authored-By: OpenAI Codex <codex@openai.com>
@msonnb
msonnb force-pushed the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch from c33c72d to 907082e Compare September 4, 2026 12:07
@msonnb
msonnb merged commit f1a1f0f into develop Sep 4, 2026
590 of 593 checks passed
@msonnb
msonnb deleted the ms/js-3492-port-sveltekit-e2e-test-apps-to-span-streaming branch September 4, 2026 12:44
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