Skip to content

Commit 76af3e3

Browse files
committed
record propagations in the browser
1 parent fead246 commit 76af3e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/tracing/src/browser/request.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export function fetchCallback(
199199
// eslint-disable-next-line @typescript-eslint/no-explicit-any
200200
const options = (handlerData.args[1] = (handlerData.args[1] as { [key: string]: any }) || {});
201201
options.headers = addTracingHeaders(request, activeTransaction.getBaggage(), span, options);
202+
activeTransaction.metadata.numPropagations += 1;
202203
}
203204
}
204205

@@ -304,6 +305,7 @@ export function xhrCallback(
304305
BAGGAGE_HEADER_NAME,
305306
mergeAndSerializeBaggage(activeTransaction.getBaggage(), headerBaggageString),
306307
);
308+
activeTransaction.metadata.numPropagations += 1;
307309
} catch (_) {
308310
// Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
309311
}

0 commit comments

Comments
 (0)