@@ -471,6 +471,7 @@ describe('_addResourceSpans', () => {
471471 [ 'url.scheme' ] : 'https' ,
472472 [ 'server.address' ] : 'example.com' ,
473473 [ 'url.same_origin' ] : true ,
474+ [ 'url.full' ] : resourceEntryName ,
474475 [ 'network.protocol.name' ] : 'http' ,
475476 [ 'network.protocol.version' ] : '1.1' ,
476477 'http.request.connect_start' : expect . any ( Number ) ,
@@ -491,6 +492,47 @@ describe('_addResourceSpans', () => {
491492 ) ;
492493 } ) ;
493494
495+ it ( 'sets url.full to the absolute resource URL with query and fragment while keeping the description origin-relative' , ( ) => {
496+ const spans : Span [ ] = [ ] ;
497+
498+ getClient ( ) ?. on ( 'spanEnd' , span => {
499+ spans . push ( span ) ;
500+ } ) ;
501+
502+ const entry = mockPerformanceResourceTiming ( {
503+ initiatorType : 'script' ,
504+ nextHopProtocol : 'http/1.1' ,
505+ } ) ;
506+
507+ _addResourceSpans ( span , entry , 'https://example.com/assets/app.js?v=42#main' , 100 , 23 , 345 ) ;
508+
509+ expect ( spans ) . toHaveLength ( 1 ) ;
510+ const json = spanToJSON ( spans [ 0 ] ! ) ;
511+ expect ( json . description ) . toBe ( '/assets/app.js?v=42#main' ) ;
512+ expect ( json . data [ 'url.full' ] ) . toBe ( 'https://example.com/assets/app.js?v=42#main' ) ;
513+ } ) ;
514+
515+ it ( 'sets url.full to the full cross-origin URL' , ( ) => {
516+ const spans : Span [ ] = [ ] ;
517+
518+ getClient ( ) ?. on ( 'spanEnd' , span => {
519+ spans . push ( span ) ;
520+ } ) ;
521+
522+ const entry = mockPerformanceResourceTiming ( {
523+ initiatorType : 'img' ,
524+ nextHopProtocol : 'http/1.1' ,
525+ } ) ;
526+
527+ _addResourceSpans ( span , entry , 'https://cdn.example.org/static/logo.png' , 100 , 23 , 345 ) ;
528+
529+ expect ( spans ) . toHaveLength ( 1 ) ;
530+ const json = spanToJSON ( spans [ 0 ] ! ) ;
531+ expect ( json . description ) . toBe ( 'https://cdn.example.org/static/logo.png' ) ;
532+ expect ( json . data [ 'url.full' ] ) . toBe ( 'https://cdn.example.org/static/logo.png' ) ;
533+ expect ( json . data [ 'url.same_origin' ] ) . toBe ( false ) ;
534+ } ) ;
535+
494536 it ( 'creates a variety of resource spans' , ( ) => {
495537 const spans : Span [ ] = [ ] ;
496538
@@ -611,6 +653,7 @@ describe('_addResourceSpans', () => {
611653 [ 'url.scheme' ] : 'https' ,
612654 [ 'server.address' ] : 'example.com' ,
613655 [ 'url.same_origin' ] : true ,
656+ [ 'url.full' ] : resourceEntryName ,
614657 [ 'network.protocol.name' ] : 'http' ,
615658 [ 'network.protocol.version' ] : '2' ,
616659 } ) ,
@@ -644,6 +687,7 @@ describe('_addResourceSpans', () => {
644687 'server.address' : 'example.com' ,
645688 'url.same_origin' : true ,
646689 'url.scheme' : 'https' ,
690+ 'url.full' : resourceEntryName ,
647691 [ 'network.protocol.name' ] : 'http' ,
648692 [ 'network.protocol.version' ] : '3' ,
649693 } ) ,
@@ -696,6 +740,7 @@ describe('_addResourceSpans', () => {
696740 'server.address' : 'example.com' ,
697741 'url.same_origin' : true ,
698742 'url.scheme' : 'https' ,
743+ 'url.full' : resourceEntryName ,
699744 [ 'network.protocol.name' ] : 'http' ,
700745 [ 'network.protocol.version' ] : '3' ,
701746 'http.request.connect_start' : expect . any ( Number ) ,
0 commit comments