@@ -79,6 +79,17 @@ export interface BrowserTracingOptions extends RequestInstrumentationOptions {
7979 ) : void ;
8080}
8181
82+ const DEFAULT_BROWSER_TRACING_OPTIONS = {
83+ beforeNavigate : defaultBeforeNavigate ,
84+ idleTimeout : DEFAULT_IDLE_TIMEOUT ,
85+ markBackgroundTransactions : true ,
86+ maxTransactionDuration : DEFAULT_MAX_TRANSACTION_DURATION_SECONDS ,
87+ routingInstrumentation : defaultRoutingInstrumentation ,
88+ startTransactionOnLocationChange : true ,
89+ startTransactionOnPageLoad : true ,
90+ ...defaultRequestInstrumentionOptions ,
91+ } ;
92+
8293/**
8394 * The Browser Tracing integration automatically instruments browser pageload/navigation
8495 * actions as transactions, and captures requests, metrics and errors as spans.
@@ -93,16 +104,7 @@ export class BrowserTracing implements Integration {
93104 public static id : string = 'BrowserTracing' ;
94105
95106 /** Browser Tracing integration options */
96- public options : BrowserTracingOptions = {
97- beforeNavigate : defaultBeforeNavigate ,
98- idleTimeout : DEFAULT_IDLE_TIMEOUT ,
99- markBackgroundTransactions : true ,
100- maxTransactionDuration : DEFAULT_MAX_TRANSACTION_DURATION_SECONDS ,
101- routingInstrumentation : defaultRoutingInstrumentation ,
102- startTransactionOnLocationChange : true ,
103- startTransactionOnPageLoad : true ,
104- ...defaultRequestInstrumentionOptions ,
105- } ;
107+ public options : BrowserTracingOptions ;
106108
107109 /**
108110 * @inheritDoc
@@ -130,7 +132,7 @@ export class BrowserTracing implements Integration {
130132 }
131133
132134 this . options = {
133- ...this . options ,
135+ ...DEFAULT_BROWSER_TRACING_OPTIONS ,
134136 ..._options ,
135137 tracingOrigins,
136138 } ;
@@ -179,7 +181,7 @@ export class BrowserTracing implements Integration {
179181 /** Create routing idle transaction. */
180182 private _createRouteTransaction ( context : TransactionContext ) : TransactionType | undefined {
181183 if ( ! this . _getCurrentHub ) {
182- logger . warn ( `[Tracing] Did not create ${ context . op } idleTransaction due to invalid _getCurrentHub ` ) ;
184+ logger . warn ( `[Tracing] Did not create ${ context . op } transaction because _getCurrentHub is invalid. ` ) ;
183185 return undefined ;
184186 }
185187
0 commit comments