sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

fix(browser): Stringify span context in linked traces log statement

Open s1gr1d opened this issue 1 month ago • 1 comments

I came upon this log Sentry Logger [log]: Adding previous_trace [object Object] link to span [object Object] and this PR fixes this by stringifying the context.

One concern I have with that is that the object could be too large (stringifying takes too long) or circular. But this should be very unlikely in this case. However, if someone else shares this concerns we might change the log to either limit the depth or to only log specific entries of the object (might add bundle size).

Closes #18377

s1gr1d avatar Dec 02 '25 13:12 s1gr1d

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.8 kB - -
@sentry/browser - with treeshaking flags 23.31 kB - -
@sentry/browser (incl. Tracing) 41.55 kB +0.03% +10 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.14 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.97 kB +0.02% +14 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.69 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 84.65 kB +0.02% +11 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.89 kB +0.02% +11 B 🔺
@sentry/browser (incl. Feedback) 41.48 kB - -
@sentry/browser (incl. sendFeedback) 29.49 kB - -
@sentry/browser (incl. FeedbackAsync) 34.47 kB - -
@sentry/react 26.52 kB - -
@sentry/react (incl. Tracing) 43.75 kB +0.03% +9 B 🔺
@sentry/vue 29.25 kB - -
@sentry/vue (incl. Tracing) 43.35 kB +0.03% +11 B 🔺
@sentry/svelte 24.82 kB - -
CDN Bundle 27.21 kB - -
CDN Bundle (incl. Tracing) 42.21 kB - -
CDN Bundle (incl. Tracing, Replay) 78.75 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 84.2 kB - -
CDN Bundle - uncompressed 79.96 kB - -
CDN Bundle (incl. Tracing) - uncompressed 125.34 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 241.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.13 kB - -
@sentry/nextjs (client) 45.97 kB +0.03% +10 B 🔺
@sentry/sveltekit (client) 41.91 kB +0.03% +11 B 🔺
@sentry/node-core 51.27 kB - -
@sentry/node 159.44 kB - -
@sentry/node - without tracing 92.85 kB - -
@sentry/aws-serverless 108.14 kB - -

View base workflow run

github-actions[bot] avatar Dec 02 '25 13:12 github-actions[bot]