Skip to content

Conversation

@AbhiPrasad
Copy link
Member

Testing out Sentry.continueTrace

At this point with runWithAsyncContext, continueTrace, and startSpan feeling like I'm in callback hell a little, but manageable.

@AbhiPrasad AbhiPrasad requested review from a team, Lms24 and lforst and removed request for a team November 20, 2023 23:15
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 65.61 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 55.72 KB (+0.09% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.01 KB (0%)
@sentry/browser - Webpack (gzipped) 21.32 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 62.03 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 29.13 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 21.26 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 195.71 KB (+0.09% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 88.38 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 63.34 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.85 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 65.92 KB (+0.13% 🔺)
@sentry/react - Webpack (gzipped) 21.36 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 82.66 KB (+0.1% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 48.15 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 16.12 KB (-0.25% 🔽)

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callback Hell

haha yeah looks a bit nested 😅 Idea for the future: We could add a startSpanFromTrace helper to somewhat shim this (?)

@lforst
Copy link
Contributor

lforst commented Nov 21, 2023

My gripe is that the continueTrace function wouldn't need to be a wrapper. It could just return the ctx instead.

@mydea
Copy link
Member

mydea commented Nov 21, 2023

Thinking about this, I think we could tweak continueTrace so that if no callback is given, it just returns the context - that should be possible, backwards compatible, I think? 🤔 so:

const ctx = continueTrace({ sentryTrace, baggage });

@AbhiPrasad AbhiPrasad merged commit 51576c2 into develop Nov 21, 2023
@AbhiPrasad AbhiPrasad deleted the abhi-continue-trace-bun branch November 21, 2023 17:04
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.

5 participants