feat(browser): Use idle span for browser tracing#10957
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
Generally looks super good to me! There is one point that needs adressing: #10957 (comment).
| const endTimestamp = latestEndTimestamp | ||
| ? Math.min(spanTimeInputToSeconds(timestamp), latestEndTimestamp) | ||
| : timestamp; |
There was a problem hiding this comment.
Something looks off here. In one case we take spanTimeInputToSeconds(timestamp), in the other case we take timestamp.
There was a problem hiding this comment.
this is fine here because we only need to convert it to a seconds timestamp for Math.min() to work reliably, otherwise we can just pass the input through whatever it is!
There was a problem hiding this comment.
Ok, I assume because we convert it to the right unit downstream somewhere? Would you mind adding a (short) comment? This might confuse the next person coming across this ^^
There was a problem hiding this comment.
updated the whole code block a bit to hopefully clarify thigns!
packages/tracing-internal/src/browser/browserTracingIntegration.ts
Outdated
Show resolved
Hide resolved
packages/tracing-internal/src/browser/browserTracingIntegration.ts
Outdated
Show resolved
Hide resolved
And remove idle transaction.
And remove idle transaction.
With this, we can afterwards remove the span recorder, and everything related to it 🎉
I tried to keep all functionality intact. Some small cleanups I made:
trimEndoption - we always set this to true anyhow). However, this only applies when the span is auto-ended by the idle functionality, not if manually callingspan.end()- which is fine IMHO because that will usually not happen for users, and even so it's not the end of the world.continueTracefor trace propagation of the pageload span.locationon the sampling context - we talked about this before, this is just gone, and users can instead either access the attributes from the sampling context, or just dowindow.location.hrefthemselves, which should have the same outcome.