1+ /* eslint-disable max-lines */
12/* eslint-disable @typescript-eslint/no-explicit-any */
23import { SpanContext } from '@sentry/types' ;
34import { getGlobalObject , logger } from '@sentry/utils' ;
@@ -214,7 +215,7 @@ function addMeasureSpans(
214215/** Create resource related spans */
215216function addResourceSpans (
216217 transaction : Transaction ,
217- entry : Record < string , any > ,
218+ entry : Record < string , unknown > ,
218219 resourceName : string ,
219220 startTime : number ,
220221 duration : number ,
@@ -226,14 +227,26 @@ function addResourceSpans(
226227 return undefined ;
227228 }
228229
230+ const tags : Record < string , string > = { } ;
231+ if ( entry . transferSize ) {
232+ tags . transferSize = ( entry . transferSize as number ) . toString ( ) ;
233+ }
234+ if ( entry . encodedBodySize ) {
235+ tags . encodedBodySize = ( entry . encodedBodySize as number ) . toString ( ) ;
236+ }
237+ if ( entry . decodedBodySize ) {
238+ tags . decodedBodySize = ( entry . decodedBodySize as number ) . toString ( ) ;
239+ }
240+
229241 const startTimestamp = timeOrigin + startTime ;
230242 const endTimestamp = startTimestamp + duration ;
231243
232244 _startChild ( transaction , {
233- description : ` ${ entry . initiatorType } ${ resourceName } ` ,
245+ description : resourceName ,
234246 endTimestamp,
235- op : 'resource' ,
247+ op : entry . initiatorType && entry . initiatorType !== '' ? `resource. ${ entry . initiatorType } ` : 'resource' ,
236248 startTimestamp,
249+ tags,
237250 } ) ;
238251
239252 return endTimestamp ;
0 commit comments