Skip to content

test(e2e): Migrate Express 4 and TSX to span streaming - #24156

Merged
msonnb merged 2 commits into
developfrom
ms/express-4-tsx-span-streaming
Sep 8, 2026
Merged

test(e2e): Migrate Express 4 and TSX to span streaming#24156
msonnb merged 2 commits into
developfrom
ms/express-4-tsx-span-streaming

Conversation

@msonnb

@msonnb msonnb commented Sep 7, 2026

Copy link
Copy Markdown
Member

Exercise Express 4 and TSX instrumentation with span streaming, including error correlation, middleware, MCP, and tRPC coverage.

part of #23800

@linear-code

linear-code Bot commented Sep 7, 2026

Copy link
Copy Markdown

JS-3484

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.8 kB added added
@sentry/browser - with treeshaking flags 27.11 kB added added
@sentry/browser - with treeshaking flags tracing without tracing 27 kB added added
@sentry/browser (incl. Tracing) 49.22 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB added added
@sentry/browser (incl. Tracing, Profiling) 52.12 kB added added
@sentry/browser (incl. Tracing, Replay) 88.76 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.95 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 106.37 kB added added
@sentry/browser (incl. Feedback) 46.3 kB added added
@sentry/browser (incl. sendFeedback) 33.86 kB added added
@sentry/browser (incl. FeedbackAsync) 38.97 kB added added
@sentry/browser (incl. Metrics) 29.82 kB added added
@sentry/browser (incl. Logs) 30.09 kB added added
@sentry/browser (incl. Metrics & Logs) 30.75 kB added added
@sentry/react 30.55 kB added added
@sentry/react (incl. Tracing) 51.56 kB added added
@sentry/vue 36.05 kB added added
@sentry/vue (incl. Tracing) 51.48 kB added added
@sentry/svelte 28.83 kB added added
CDN Bundle 30.55 kB added added
CDN Bundle (incl. Tracing) 49.74 kB added added
CDN Bundle (incl. Logs, Metrics) 32.82 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB added added
CDN Bundle (incl. Tracing, Replay) 87.29 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.18 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 93.22 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.21 kB added added
CDN Bundle - uncompressed 90.46 kB added added
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.03 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.14 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.29 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB added added
@sentry/nextjs (client) 54 kB added added
@sentry/sveltekit (client) 49.65 kB added added
@sentry/core/server 36.99 kB added added
@sentry/core/browser 13.55 kB added added
@sentry/node 127.75 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB added added
@sentry/node - without tracing 88.73 kB added added
@sentry/node - without channel injection 106.99 kB added added
@sentry/aws-serverless 97.12 kB added added
@sentry/cloudflare (withSentry) - minified 201.95 kB added added
@sentry/cloudflare (withSentry) 502.67 kB added added

View base workflow run

@msonnb
msonnb marked this pull request as ready for review September 7, 2026 12:51
@msonnb
msonnb requested review from a team, andreiborza, isaacs and nicohrubec and removed request for a team September 7, 2026 12:51
Co-Authored-By: GPT-6 <codex@openai.com>
@msonnb
msonnb force-pushed the ms/express-4-tsx-span-streaming branch from eadfc90 to 149bf8e Compare September 7, 2026 13:17
expect(errorEvent.contexts?.trace?.trace_id).toBe(transactionTrace?.trace_id);
// The error is attached to the same trace as the request segment, and to a
// span in that segment.
const segmentTrace = segmentEvent;

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.

can we get rid of this alias?

expect(transactionSpanIds).toContain(errorEvent.contexts?.trace?.span_id);
// The error is attached to the same trace as the request segment, and to a
// span in that segment.
const segmentTrace = segmentEvent;

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.

same here

import { waitForStreamedSpan, getSpanOp, collectStreamedSpansUntilSegment } from '@sentry-internal/test-utils';

test('Sends an API route span', async ({ baseURL }) => {
const pageloadSegmentEventPromise = collectStreamedSpansUntilSegment(

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.

since this is an express app we probably don't have pageloads?

}),
);

expect(segmentEvent.attributes['http.response.status_code']?.value).toBe(200);

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 already asserted above so seems redundant

}),
);

expect(segmentEvent.attributes['http.response.status_code']?.value).toBe(200);

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.

same here also redundant I think

Co-Authored-By: GPT-6 <codex@openai.com>
@msonnb

msonnb commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

@nicohrubec addressed all in ec4b6bc

@nicohrubec nicohrubec left a comment

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.

🚀

@msonnb
msonnb merged commit a152971 into develop Sep 8, 2026
312 of 313 checks passed
@msonnb
msonnb deleted the ms/express-4-tsx-span-streaming branch September 8, 2026 12:47
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