Skip to content

feat(core): Lookup client on current scope, not hub #10635

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

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 13, 2024

One more step to avoid the hub...

Note: This showed a potential footgun (?), where if you pass a client-less scope to startSpan(), no span will be created (because no client = no tracing, and the given scope will be made the current scope in the callback). this is correct behavior here, but could be a bit unexpected ("why is no span being created here??"). We could think about warning if a client-less scope is passed in there, but not sure if that's worth it...

One more step to avoid the hub...
@mydea mydea requested review from lforst, Lms24 and AbhiPrasad February 13, 2024 10:52
@mydea mydea self-assigned this Feb 13, 2024
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.95 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.18 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 73.11 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.8 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.38 KB (+0.02% 🔺)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 33.24 KB (+0.01% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.16 KB (+0.01% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.16 KB (+0.03% 🔺)
@sentry/browser - Webpack (gzipped) 22.44 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 76.1 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.6 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.59 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.64 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 212.93 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 101.55 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.83 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.83 KB (+0.01% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.55 KB (+0.01% 🔺)
@sentry/react - Webpack (gzipped) 22.46 KB (+0.02% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 87.31 KB (+0.01% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.44 KB (+0.01% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.11 KB (+0.06% 🔺)

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.

where if you pass a client-less scope to startSpan()

I still find it weird that we support passing a scope in general but I assume there's a good reason for that (otel?)...

@mydea
Copy link
Member Author

mydea commented Feb 13, 2024

where if you pass a client-less scope to startSpan()

I still find it weird that we support passing a scope in general but I assume there's a good reason for that (otel?)...

the reason for this is to allow to start a span as a child of a specific other span - you can pass a scope that has a current span, which will have the new span attached to it!

@mydea mydea merged commit 33a6232 into develop Feb 13, 2024
@mydea mydea deleted the fn/getClient branch February 13, 2024 12:45
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