@@ -65,14 +65,12 @@ export interface Profile {
6565 image_vmaddr : string ;
6666 } [ ] ;
6767 } ;
68- transactions : {
68+ transaction : {
6969 name : string ;
70- trace_id : string ;
7170 id : string ;
71+ trace_id : string ;
7272 active_thread_id : string ;
73- relative_start_ns : string ;
74- relative_end_ns : string ;
75- } [ ] ;
73+ } ;
7674}
7775
7876function isRawThreadCpuProfile ( profile : ThreadCpuProfile | RawThreadCpuProfile ) : profile is RawThreadCpuProfile {
@@ -199,7 +197,6 @@ export function createProfilingEventEnvelope(
199197 const envelopeHeaders = createEventEnvelopeHeaders ( event , sdkInfo , tunnel , dsn ) ;
200198 const enrichedThreadProfile = enrichWithThreadInformation ( rawProfile ) ;
201199 const transactionStartMs = typeof event . start_timestamp === 'number' ? event . start_timestamp * 1000 : Date . now ( ) ;
202- const transactionEndMs = typeof event . timestamp === 'number' ? event . timestamp * 1000 : Date . now ( ) ;
203200
204201 const traceId = ( event ?. contexts ?. [ 'trace' ] ?. [ 'trace_id' ] as string ) ?? '' ;
205202 // Log a warning if the profile has an invalid traceId (should be uuidv4).
@@ -236,16 +233,12 @@ export function createProfilingEventEnvelope(
236233 is_emulator : false
237234 } ,
238235 profile : enrichedThreadProfile ,
239- transactions : [
240- {
241- name : event . transaction || '' ,
242- id : event . event_id || uuid4 ( ) ,
243- trace_id : traceId ,
244- active_thread_id : THREAD_ID_STRING ,
245- relative_start_ns : '0' ,
246- relative_end_ns : ( ( transactionEndMs - transactionStartMs ) * 1e6 ) . toFixed ( 0 )
247- }
248- ]
236+ transaction : {
237+ name : event . transaction || '' ,
238+ id : event . event_id || uuid4 ( ) ,
239+ trace_id : traceId ,
240+ active_thread_id : THREAD_ID_STRING
241+ }
249242 } ;
250243
251244 const envelopeItem : EventItem = [
0 commit comments