diff --git a/packages/svelte/src/performance.ts b/packages/svelte/src/performance.ts index 100f9f732ddc..2bf23668c478 100644 --- a/packages/svelte/src/performance.ts +++ b/packages/svelte/src/performance.ts @@ -1,4 +1,4 @@ -import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan } from '@sentry/browser'; +import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser'; import type { Span } from '@sentry/types'; import { afterUpdate, beforeUpdate, onMount } from 'svelte'; import { current_component } from 'svelte/internal'; @@ -59,13 +59,8 @@ function recordInitSpan(componentName: string): void { function recordUpdateSpans(componentName: string): void { let updateSpan: Span | undefined; beforeUpdate(() => { - // If there is no active span, we skip - const activeSpan = getActiveSpan(); - if (!activeSpan) { - return; - } - updateSpan = startInactiveSpan({ + onlyIfParent: true, op: UI_SVELTE_UPDATE, name: componentName, attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },