Skip to content

feat(core): Extract sampleTransaction method out #9136

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
Oct 3, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Sep 28, 2023

This extracts the sampleTransaction method out and exports this from core so we can use it for POTEL (where we build transactions differently).

This is needed for #9085.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 84.23 KB (-0.03% 🔽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.4 KB (-0.01% 🔽)
@sentry/browser - Webpack (gzipped) 22 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 78.68 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.5 KB (-0.01% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.59 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 254.1 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 86.38 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 61.23 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.37 KB (-0.02% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 84.26 KB (-0.02% 🔽)
@sentry/react - Webpack (gzipped) 22.03 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 102.22 KB (+0.03% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.98 KB (+0.06% 🔺)

Copy link
Contributor

@lforst lforst left a comment

Choose a reason for hiding this comment

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

I don't wanna hard block this but is there any chance we can vendor this into the otel SDK? Right now this change just increases API surface and exposes an implementation detail without any real upside to the user.

@mydea
Copy link
Member Author

mydea commented Sep 29, 2023

I don't wanna hard block this but is there any chance we can vendor this into the otel SDK? Right now this change just increases API surface and exposes an implementation detail without any real upside to the user.

I get what you mean, I was also not 100% sure. IMHO it is not super trivial code, we can of course copy this into node-experimental but since the trajectory for this is rather that we prob. want to expand on the POTEL stuff, I feel eventually we do not want to duplicate this as they should behave the same in both scenarios, we don't want them to drift apart 🤔

Personally, I would argue that the API that is exported from @sentry/core is really mostly designed to be used by us, not by users, so I'd say it's OK (I would not export this from e.g. @sentry/browser or @sentry/node). What do you think?

Copy link
Contributor

@lforst lforst left a comment

Choose a reason for hiding this comment

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

I would argue that the API that is exported from @sentry/core is really mostly designed to be used by us

That doesn't really matter. Anything that is publicly exposed is a pain to refactor from that point onwards. You can't remove it, change params, rename it, ... . @sentry/core needs to follow semver. Any third party SDK depends on it.

But as I said, I don't wanna hard block. I just wanted you to think about it so: rubber stamp.

@mydea mydea merged commit 5d8b674 into develop Oct 3, 2023
@mydea mydea deleted the fn/extract-sample-transaction branch October 3, 2023 07:23
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.

3 participants