File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/tracing/src/browser Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,14 @@ export function registerRequestInstrumentation(_options?: Partial<RequestInstrum
100100 return urlMap [ url ] ;
101101 } ;
102102
103- const shouldCreateSpan = shouldCreateSpanForRequest || defaultShouldCreateSpan ;
103+ // We want that our users don't have to re-implement shouldCreateSpanForRequest themselves
104+ // That's why we filter out already unwanted Spans from tracingOrigins
105+ let shouldCreateSpan = defaultShouldCreateSpan ;
106+ if ( typeof shouldCreateSpanForRequest === 'function' ) {
107+ shouldCreateSpan = ( url : string ) => {
108+ return defaultShouldCreateSpan ( url ) && shouldCreateSpanForRequest ( url ) ;
109+ } ;
110+ }
104111
105112 const spans : Record < string , Span > = { } ;
106113
You can’t perform that action at this time.
0 commit comments