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..92b62c636249 100644 --- a/packages/browser/src/profiling/hubextensions.ts +++ b/packages/browser/src/profiling/hubextensions.ts @@ -172,9 +172,13 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact return null; } + const stopProfilerSpan = transaction.startChild({ description: 'profiler.stop' }); + return profiler .stop() .then((p: JSSelfProfile): null => { + stopProfilerSpan.finish(); + if (maxDurationTimeoutID) { WINDOW.clearTimeout(maxDurationTimeoutID); maxDurationTimeoutID = undefined; @@ -199,6 +203,7 @@ export function wrapTransactionWithProfiling(transaction: Transaction): Transact return null; }) .catch(error => { + stopProfilerSpan.finish(); if (__DEBUG_BUILD__) { logger.log('[Profiling] error while stopping profiler:', error); }