test(browser): Add span streaming integration tests#19581
test(browser): Add span streaming integration tests#19581Lms24 wants to merge 16 commits intolms/feat-span-firstfrom
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
c2b23bf to
e4011e4
Compare
Codecov Results 📊Generated by Codecov Action |
24015b1 to
e5c1208
Compare
…nsampled traces being sent
…SpanActiveInBrowser
4dbb4e3 to
9f490f4
Compare
...ser-integration-tests/suites/tracing/browserTracingIntegration/http-timings-streamed/test.ts
Outdated
Show resolved
Hide resolved
JPeer264
left a comment
There was a problem hiding this comment.
LGTM.
FWIW I didn't go over every test in detail, but picked a couple and they looked fine. I also went over with Cursor and randomly changed span names in the tests and commented out code to verify if all tests were actually expecting the correct things - also this check passed.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| return; | ||
| } | ||
| buffer.add(captureSpan(span, client)); | ||
| }); |
There was a problem hiding this comment.
Bundle size increases across multiple browser packages
Low Severity
This PR bumps size limits by 1KB across three browser packages (@sentry/browser Logs: 27→28KB, @sentry/react Tracing: 45→46KB, CDN Replay+Logs+Metrics: 209→210KB). The spanstreaming.ts change from a one-line arrow to a multi-line if-block contributes unnecessary bytes, as already noted in the PR discussion. The reviewer's suggestion to use a more concise expression (e.g., short-circuit &&) would reduce the footprint. Flagged because it was mentioned in the rules file.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot


This PR adds browser integration to test testing span streaming:
waitForStreamedSpan: Returns a promise of a single matching spanwaitForStreamedSpans: Returns a promise of all spans in an array whenever the callback returns truewaitForStreamedSpanEnvelope: Returns an entire streamed span (v2) envelope (including headers)observeStreamedSpan: Can be used to observe sent span envelopes without blocking the test if no envelopes are sent (good for testing that spans are not sent)getSpanOp: Small helper to easily get the op of a span which we almost always need for thewaitFor*function callbacksAdded 50+ tests, mostly converted from transaction integration tests around spans from
browserTracingIntegration:Also, this PR fixes two bugs discovered through tests:
errorinstead ofok. We want them to have statusokbut an attribute detailing the cancellation reason.Lastly, I discovered a problem with timing data on fetch and XHR spans. Will try to fix as a follow-up. Tracked in #19613
ref #17836