diff --git a/packages/browser/src/profiling/cache.ts b/packages/browser/src/profiling/cache.ts deleted file mode 100644 index 34b5da5d12fa..000000000000 --- a/packages/browser/src/profiling/cache.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Event } from '@sentry/types'; -import { makeFifoCache } from '@sentry/utils'; - -export const PROFILING_EVENT_CACHE = makeFifoCache(20); diff --git a/packages/browser/src/profiling/hubextensions.ts b/packages/browser/src/profiling/hubextensions.ts index 1c04eeb68362..49763ac35659 100644 --- a/packages/browser/src/profiling/hubextensions.ts +++ b/packages/browser/src/profiling/hubextensions.ts @@ -172,9 +172,15 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact return null; } + // This is temporary - we will use the collected span data to evaluate + // if deferring txn.finish until profiler resolves is a viable approach. + const stopProfilerSpan = transaction.startChild({ description: 'profiler.stop', op: 'profiler' }); + return profiler .stop() .then((p: JSSelfProfile): null => { + stopProfilerSpan.finish(); + if (maxDurationTimeoutID) { WINDOW.clearTimeout(maxDurationTimeoutID); maxDurationTimeoutID = undefined; @@ -199,6 +205,7 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact return null; }) .catch(error => { + stopProfilerSpan.finish(); if (__DEBUG_BUILD__) { logger.log('[Profiling] error while stopping profiler:', error); }