Skip to content

Commit a0a79fa

Browse files
committed
better comments
1 parent c1cae1a commit a0a79fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/tracing-internal/src/browser/browserTracingIntegration.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ export const _browserTracingIntegration = ((_options: Partial<BrowserTracingOpti
329329

330330
if (client.on) {
331331
client.on('startNavigationSpan', (context: StartSpanOptions) => {
332+
// We check this inside of the hook handler, so that if a custom instrumentation triggers this,
333+
// we don't need to check this option in the instrumentation, but can simply invoke it
334+
// without needing to know the options of this integration
332335
if (!options.instrumentNavigation) {
333336
return;
334337
}
@@ -342,6 +345,9 @@ export const _browserTracingIntegration = ((_options: Partial<BrowserTracingOpti
342345
});
343346

344347
client.on('startPageLoadSpan', (context: StartSpanOptions) => {
348+
// We check this inside of the hook handler, so that if a custom instrumentation triggers this,
349+
// we don't need to check this option in the instrumentation, but can simply invoke it
350+
// without needing to know the options of this integration
345351
if (!options.instrumentPageLoad) {
346352
return;
347353
}
@@ -385,6 +391,7 @@ export const _browserTracingIntegration = ((_options: Partial<BrowserTracingOpti
385391

386392
if (from !== to) {
387393
startingUrl = undefined;
394+
// We check this in here again, as a custom instrumentation may have been triggered in the meanwhile
388395
if (shouldUseDefaultNavigationSpan) {
389396
const context: StartSpanOptions = {
390397
name: WINDOW.location.pathname,

0 commit comments

Comments
 (0)