-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): Emit hooks for transaction start/finish #7387
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
Conversation
8116695
to
e6e1d59
Compare
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @AbhiPrasad!
Apologies if this is the wrong place to ask (LMK where is better!), but I saw this in the release notes and started to use it to clean up some messy code I have around spans. However, the issue this is based on says:
…so I’m wondering if I should actually avoid using these events. (Side note: it would be really helpful to not include private APIs in release notes, or at least call out what things are not for public use. 🙏 ) |
@Mr0grog we need to include some stuff about internals because we have downstream SDK consumers (https://github.com/getsentry/sentry-electron and https://github.com/getsentry/sentry-react-native for example). Curious about your use case - maybe we do end up documenting this properly. What are you doing exactly with hooks? We only recommend only using the API that is directly referenced via our documentation, but anything exposed as public API (class methods, exports) will not break until the next major version. |
Oh, we have some terrifyingly horrible hacks to try and make adding spans work well: https://gist.github.com/Mr0grog/bf88c0e003fc07cb2ca6271f426ba65e The transaction finishing event is useful because we want most spans that never finished to get included in the transaction (probably an exception occurred that prevented us from getting to the |
This is typed this way because JavaScript lol, but for for standard use you can pretty much always consider a hub/client to exist on a transaction that has been sampled. |
We need to make this better, let me take this back to the team. |
Ah, good to know! So we could check |
Builds on top of #7370
For now closes #7262 (but we still need to add replay hooks).