Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(browser): Ensure start time of interaction root and child span is aligned #14188

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 5, 2024

This PR replaces the manual start and end calls for interaction child spans with our startAndEndSpan helper.
Using startAndEndSpan also will adjust the root span's start time stamp if the (in this case interaction-) child span starts earlier than the parent span. I think in this particular case, this is fine or even desireable because my testing so far has shown that the performance entry we use for the child spans starts a couple of ms earlier than the surrounding idle interaction transaction. We can add a similar check as in #14183 or #14186 if this becomes a problem.

Further context: If users enable experiments.enableInteractions, for every click, we create:

  1. A root idle span whose name is the name of the current route (unless there's an ongoing pageload/navigation span)
  2. A child span whose name is the computed selector of the clicked element.

EDIT: Initially, I did this to reduce bundle size but it looks like this actually isn't happening. On the plus side, I think the behaviour change is still worth to merge in and the size increase is negligible. Maybe, it's even within the usual margin of error of our size check. Anyway, the code change is the same, I just re-purposed the PR a bit 😅

@Lms24 Lms24 self-assigned this Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.76 KB - -
@sentry/browser - with treeshaking flags 21.54 KB - -
@sentry/browser (incl. Tracing) 35.19 KB +0.03% +10 B 🔺
@sentry/browser (incl. Tracing, Replay) 71.92 KB +0.02% +14 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.34 KB +0.02% +11 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.23 KB +0.02% +14 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.03 KB +0.02% +10 B 🔺
@sentry/browser (incl. Feedback) 39.9 KB - -
@sentry/browser (incl. sendFeedback) 27.4 KB - -
@sentry/browser (incl. FeedbackAsync) 32.2 KB - -
@sentry/react 25.51 KB - -
@sentry/react (incl. Tracing) 38.16 KB +0.03% +9 B 🔺
@sentry/vue 26.9 KB - -
@sentry/vue (incl. Tracing) 37.07 KB +0.02% +7 B 🔺
@sentry/svelte 22.9 KB - -
CDN Bundle 24.1 KB - -
CDN Bundle (incl. Tracing) 37 KB +0.03% +8 B 🔺
CDN Bundle (incl. Tracing, Replay) 71.67 KB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 77.02 KB +0.02% +13 B 🔺
CDN Bundle - uncompressed 70.66 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.78 KB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 222.3 KB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 235.52 KB -0.01% -4 B 🔽
@sentry/nextjs (client) 38.24 KB +0.03% +10 B 🔺
@sentry/sveltekit (client) 35.79 KB +0.03% +9 B 🔺
@sentry/node 131.52 KB - -
@sentry/node - without tracing 95.64 KB - -
@sentry/aws-serverless 105.91 KB - -

View base workflow run

@Lms24
Copy link
Member Author

Lms24 commented Nov 5, 2024

wait, how is this increasing bundle size 😭

@Lms24 Lms24 changed the title ref(browser): Reduce bundle size for starting interaction child spans ref(browser): Ensure start time of interaction root and child span is aligned Nov 5, 2024
@Lms24 Lms24 merged commit 0c36564 into develop Nov 6, 2024
142 checks passed
@Lms24 Lms24 deleted the lms/ref-interaction-spans-startAndEndSpan branch November 6, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants