@@ -2,7 +2,7 @@ import { defineIntegration, getCurrentScope, getIsolationScope, getRootSpan, spa
22import type { NodeClient } from '@sentry/node' ;
33import type { Event , Integration , IntegrationFn , Profile , ProfileChunk , Span } from '@sentry/types' ;
44
5- import { LRUMap , logger , timestampInSeconds , uuid4 } from '@sentry/utils' ;
5+ import { LRUMap , logger , uuid4 } from '@sentry/utils' ;
66
77import { getGlobalScope } from '../../core/src/currentScopes' ;
88import { CpuProfilerBindings } from './cpu_profiler' ;
@@ -149,7 +149,6 @@ function setupAutomatedSpanProfiling(client: NodeClient): void {
149149interface ChunkData {
150150 id : string ;
151151 timer : NodeJS . Timeout | undefined ;
152- startTimestampMS : number ;
153152 startTraceID : string ;
154153}
155154class ContinuousProfiler {
@@ -217,7 +216,7 @@ class ContinuousProfiler {
217216
218217 const profile = this . _stopChunkProfiling ( this . _chunkData ) ;
219218
220- if ( ! profile || ! this . _chunkData . startTimestampMS ) {
219+ if ( ! profile ) {
221220 DEBUG_BUILD && logger . log ( `[Profiling] _chunkiledStartTraceID to collect profile for: ${ this . _chunkData . id } ` ) ;
222221 return ;
223222 }
@@ -226,17 +225,11 @@ class ContinuousProfiler {
226225 }
227226
228227 DEBUG_BUILD && logger . log ( `[Profiling] Profile chunk ${ this . _chunkData . id } sent to Sentry.` ) ;
229- const chunk = createProfilingChunkEvent (
230- this . _chunkData . startTimestampMS ,
231- this . _client ,
232- this . _client . getOptions ( ) ,
233- profile ,
234- {
235- chunk_id : this . _chunkData . id ,
236- trace_id : this . _chunkData . startTraceID ,
237- profiler_id : this . _profilerId ,
238- } ,
239- ) ;
228+ const chunk = createProfilingChunkEvent ( this . _client , this . _client . getOptions ( ) , profile , {
229+ chunk_id : this . _chunkData . id ,
230+ trace_id : this . _chunkData . startTraceID ,
231+ profiler_id : this . _profilerId ,
232+ } ) ;
240233
241234 if ( ! chunk ) {
242235 DEBUG_BUILD && logger . log ( `[Profiling] Failed to create profile chunk for: ${ this . _chunkData . id } ` ) ;
@@ -341,7 +334,6 @@ class ContinuousProfiler {
341334 this . _chunkData = {
342335 id : uuid4 ( ) ,
343336 startTraceID : traceId ,
344- startTimestampMS : timestampInSeconds ( ) ,
345337 timer : undefined ,
346338 } ;
347339 }
0 commit comments