feat(core): Emit hooks for transaction start/finish#7387
Conversation
8116695 to
e6e1d59
Compare
size-limit report 📦
|
|
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).