File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/tracing/src/browser Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,12 @@ export function _fetchCallback(
159
159
160
160
const activeTransaction = getActiveTransaction ( ) ;
161
161
if ( activeTransaction ) {
162
+ // TODO: If sampled = false, we're creating a span here merely to be able to use the toTraceparent method (the span
163
+ // won't be stored anywhere, so it'll get garbage collected when it goes out of scope here). Further, that header is
164
+ // going to contain a parentId for a span which won't exist past this moment, which feels like a little bit of a
165
+ // lie. (If the sampling decision is inherited on the backend, it doesn't matter, but in case it isn't...) Perhaps
166
+ // toTraceparent should be a function instead, and return a header w a traceId and sampling decision but no parentId
167
+ // if the parent is unsampled? (The same thing applies to the XHR callback.)
162
168
const span = activeTransaction . startChild ( {
163
169
data : {
164
170
...handlerData . fetchData ,
You can’t perform that action at this time.
0 commit comments