From b6aa6a557b7bdc3e7ec707dac20f2affb92c9d5e Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 13 Nov 2024 16:22:57 +0100 Subject: [PATCH] ref(vue): Reduce bundle size for starting application render span --- packages/vue/src/tracing.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/vue/src/tracing.ts b/packages/vue/src/tracing.ts index 3085e528bbf0..c00bdd184c20 100644 --- a/packages/vue/src/tracing.ts +++ b/packages/vue/src/tracing.ts @@ -81,18 +81,16 @@ export const createTracingMixins = (options: TracingOptions): Mixins => { const isRoot = this.$root === this; if (isRoot) { - const activeSpan = getActiveSpan(); - if (activeSpan) { - this.$_sentryRootSpan = - this.$_sentryRootSpan || - startInactiveSpan({ - name: 'Application Render', - op: `${VUE_OP}.render`, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.vue', - }, - }); - } + this.$_sentryRootSpan = + this.$_sentryRootSpan || + startInactiveSpan({ + name: 'Application Render', + op: `${VUE_OP}.render`, + attributes: { + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.vue', + }, + onlyIfParent: true, + }); } // Skip components that we don't want to track to minimize the noise and give a more granular control to the user