Skip to content

test(e2e): Port the nestjs-distributed-tracing E2E app to span streaming - #24108

Merged
chargome merged 6 commits into
developfrom
cg/e2e-nestjs-distributed-tracing-streaming
Sep 9, 2026
Merged

test(e2e): Port the nestjs-distributed-tracing E2E app to span streaming#24108
chargome merged 6 commits into
developfrom
cg/e2e-nestjs-distributed-tracing-streaming

Conversation

@chargome

@chargome chargome commented Sep 4, 2026

Copy link
Copy Markdown
Member

Removes the traceLifecycle: 'static' pin and rewrites the specs against streamed spans.

Streamed spans carry neither scope tags nor breadcrumbs, so the event-handler specs have the app report its isolation scope as span attributes, the same way the Next.js middleware specs do.

Ref: #23801

🤖 Generated with Claude Code

Removes the `traceLifecycle: 'static'` pin and rewrites the specs against streamed spans.

Streamed spans carry neither scope tags nor breadcrumbs, so the event-handler specs have the app report its isolation scope as span attributes, the same way the Next.js middleware specs do.

Ref: #23801

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome chargome self-assigned this Sep 4, 2026
@chargome

chargome commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

bugbot run

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

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.81 kB +0.04% +11 B 🔺
@sentry/browser - with treeshaking flags 27.12 kB +0.04% +10 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.01 kB +0.03% +7 B 🔺
@sentry/browser (incl. Tracing) 49.22 kB -0.01% -2 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB +0.02% +5 B 🔺
@sentry/browser (incl. Tracing, Profiling) 52.15 kB +0.05% +21 B 🔺
@sentry/browser (incl. Tracing, Replay) 88.76 kB -0.01% -2 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.94 kB -0.02% -10 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 106.38 kB +0.01% +10 B 🔺
@sentry/browser (incl. Feedback) 46.3 kB +0.02% +5 B 🔺
@sentry/browser (incl. sendFeedback) 33.87 kB +0.02% +6 B 🔺
@sentry/browser (incl. FeedbackAsync) 38.99 kB +0.04% +13 B 🔺
@sentry/browser (incl. Metrics) 29.84 kB +0.08% +23 B 🔺
@sentry/browser (incl. Logs) 30.1 kB +0.06% +18 B 🔺
@sentry/browser (incl. Metrics & Logs) 30.78 kB +0.11% +31 B 🔺
@sentry/react 30.57 kB +0.05% +14 B 🔺
@sentry/react (incl. Tracing) 51.57 kB +0.03% +12 B 🔺
@sentry/vue 36.07 kB +0.05% +17 B 🔺
@sentry/vue (incl. Tracing) 51.49 kB +0.04% +19 B 🔺
@sentry/svelte 28.85 kB +0.06% +15 B 🔺
CDN Bundle 30.56 kB +0.05% +15 B 🔺
CDN Bundle (incl. Tracing) 49.76 kB +0.06% +25 B 🔺
CDN Bundle (incl. Logs, Metrics) 32.83 kB +0.03% +9 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB -0.01% -1 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay) 87.28 kB -0.01% -8 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.2 kB +0.03% +20 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 93.21 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.22 kB +0.01% +8 B 🔺
CDN Bundle - uncompressed 90.47 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB -0.01% -1 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.04 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.13 kB -0.01% -1 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.3 kB +0.01% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB -0.01% -1 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB -0.01% -1 B 🔽
@sentry/nextjs (client) 54.03 kB +0.06% +31 B 🔺
@sentry/sveltekit (client) 49.68 kB +0.06% +26 B 🔺
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.86 kB +0.06% +67 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB - -
@sentry/node - without tracing 88.73 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 107.11 kB +0.08% +80 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 201.98 kB - -
@sentry/cloudflare (withSentry) 502.68 kB - -

View base workflow run

…wrapper

The local `waitForSegmentSpan` only re-expressed what `waitForStreamedSpan` already
does, and was copied into every ported app.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome

chargome commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

bugbot run

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 62fb4b6. Configure here.

…racing helper

Streamed spans do carry scope user, attributes and contexts; only tags and
breadcrumbs never reach them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome
chargome marked this pull request as ready for review September 7, 2026 12:48
Switches the span assertions from `toMatchObject` to `toEqual` so an unexpected
field fails the test. These are all segment spans, whose attributes include the
scope contexts and SDK integration list, so the attribute matching stays partial.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
end_timestamp: expect.any(Number),
is_segment: true,
attributes: expect.objectContaining({
'sentry.origin': { type: 'string', value: 'auto.http.http_server' },

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: looks like this test misses a few attributes we previously had on the transaction test

end_timestamp: expect.any(Number),
is_segment: true,
attributes: expect.objectContaining({
'sentry.origin': { type: 'string', value: 'auto.http.http_server' },

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: on this one, too

…to assert

The port narrowed the segment span assertions to a handful of attributes. This
pins the same set the transaction-based specs did - transport, client, network and
request headers - now grouped in helpers rather than repeated four times.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome
chargome merged commit a9b50dd into develop Sep 9, 2026
91 of 93 checks passed
@chargome
chargome deleted the cg/e2e-nestjs-distributed-tracing-streaming branch September 9, 2026 10:26
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