@@ -101,6 +101,8 @@ const DEFAULT_BROWSER_TRACING_OPTIONS = {
101
101
...defaultRequestInstrumentationOptions ,
102
102
} ;
103
103
104
+ let emitOptionsWarning = false ;
105
+
104
106
/**
105
107
* The Browser Tracing integration automatically instruments browser pageload/navigation
106
108
* actions as transactions, and captures requests, metrics and errors as spans.
@@ -126,8 +128,6 @@ export class BrowserTracing implements Integration {
126
128
127
129
private readonly _metrics : MetricsInstrumentation ;
128
130
129
- private readonly _emitOptionsWarning : boolean = false ;
130
-
131
131
/** Store configured idle timeout so that it can be added as a tag to transactions */
132
132
private _configuredIdleTimeout : BrowserTracingOptions [ 'idleTimeout' ] | undefined = undefined ;
133
133
@@ -139,7 +139,7 @@ export class BrowserTracing implements Integration {
139
139
if ( _options . tracingOrigins && Array . isArray ( _options . tracingOrigins ) && _options . tracingOrigins . length !== 0 ) {
140
140
tracingOrigins = _options . tracingOrigins ;
141
141
} else {
142
- isDebugBuild ( ) && ( this . _emitOptionsWarning = true ) ;
142
+ isDebugBuild ( ) && ( emitOptionsWarning = true ) ;
143
143
}
144
144
}
145
145
@@ -159,7 +159,7 @@ export class BrowserTracing implements Integration {
159
159
public setupOnce ( _ : ( callback : EventProcessor ) => void , getCurrentHub : ( ) => Hub ) : void {
160
160
this . _getCurrentHub = getCurrentHub ;
161
161
162
- if ( this . _emitOptionsWarning ) {
162
+ if ( emitOptionsWarning ) {
163
163
isDebugBuild ( ) &&
164
164
logger . warn (
165
165
'[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace.' ,
0 commit comments