test(browser): Add span streaming integration tests#19581
test(browser): Add span streaming integration tests#19581Lms24 wants to merge 15 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
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.
...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.
| */ | ||
| export function getSimpleStatusMessage(status: SpanStatus | undefined): 'ok' | 'error' { | ||
| return !status || status.code === SPAN_STATUS_OK || status.code === SPAN_STATUS_UNSET ? 'ok' : 'error'; | ||
| if ( |
There was a problem hiding this comment.
l: Any reason why this moved away from a ternary? I think this adds now a few bytes
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