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

feat(core): Introduce startSpanManual #8913

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Aug 30, 2023

Based on #8911 and convos in slack, it was brought up that we might need to expose a method that works similar to startSpan, but that does not automatically finish the span at the end of the callback.

This is necessary when you have event emitters (res.once) or similar.

Sentry.startActiveSpanManual(ctx, (span, finish) => {
  // do something with span
  // when you're done, call finish()
  finish();
});

@AbhiPrasad AbhiPrasad requested a review from mydea August 30, 2023 12:48
@mydea
Copy link
Member

mydea commented Aug 30, 2023

What about having an API like this:

Sentry.startActiveSpanManual(ctx, function(span, finish) {
  // do something with span
  // when you're done, call finish()
  finish();
}

Would make overwriting this for OTEL easier, as we can under the hood change what finish does?

@AbhiPrasad
Copy link
Member Author

What about having an API like this

I like that a lot, thanks for the suggestion!

@AbhiPrasad AbhiPrasad marked this pull request as ready for review August 30, 2023 14:11
@AbhiPrasad AbhiPrasad requested review from a team and kamilogorek and removed request for a team August 30, 2023 14:11
@AbhiPrasad
Copy link
Member Author

temporarily putting this off until we make decision about naming tomorrow.

@AbhiPrasad AbhiPrasad changed the title feat(core): Introduce startActiveSpanManual feat(core): Introduce startSpanManual Sep 7, 2023
@AbhiPrasad
Copy link
Member Author

updated based on changes in #8971

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.37 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.27 KB (0%)
@sentry/browser - Webpack (gzipped) 21.87 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 70.18 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.49 KB (+0.26% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.56 KB (+0.4% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 221.88 KB (+0.16% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 86.17 KB (+0.41% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 61.01 KB (+0.58% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.35 KB (+0.2% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.39 KB (+0.01% 🔺)
@sentry/react - Webpack (gzipped) 21.9 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.25 KB (-0.01% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 50.83 KB (+0.01% 🔺)

@AbhiPrasad AbhiPrasad merged commit 3db988f into develop Sep 11, 2023
78 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-start-active-span-manual branch September 11, 2023 20:29
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.

None yet

3 participants