You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to integrate with profiling, the SDK needs to expose a couple of new lifecycle hooks. Primarily we need hooks on startTransaction, and transaction.finish() so that profiling can start/end profiles.
Replay also needs something similar, but centered around [TBD FILL THIS IN]. For now we aim not to solve for the Replay case specifically, but we should keep it in mind.
Solution Brainstorm
Let's introduce hooks to the Sentry client. These live on the client and as stored as simple function pointers.
typeHook=Record<KnownHooks,Function[]>;
^ The type above prob needs to actually be a union or overload of some sort so we get better intellisense, but our TS version might hold us back from it 😭.
Whenever we need to add a hook, we access the client, and call `client.on('...');
Whenever a hook is called, we call client.emit('...'), which will iterate through the array of hooks and call them all one at a time.
This is special case - but we need this to unblock profiling so let's . We keep these APIs completely internal, we can change it later on.
Based on whatever we do here - we can update getsentry/rfcs#34 accordingly, but let's try to solve this for JavaScript first, and then try to generalize. We can always fix inconsistencies with v8.
Problem Statement
In order to integrate with profiling, the SDK needs to expose a couple of new lifecycle hooks. Primarily we need hooks on
startTransaction
, andtransaction.finish()
so that profiling can start/end profiles.Replay also needs something similar, but centered around [TBD FILL THIS IN]. For now we aim not to solve for the Replay case specifically, but we should keep it in mind.
Solution Brainstorm
Let's introduce hooks to the Sentry client. These live on the client and as stored as simple function pointers.
^ The type above prob needs to actually be a union or overload of some sort so we get better intellisense, but our TS version might hold us back from it 😭.
Whenever we need to add a hook, we access the client, and call `client.on('...');
Whenever a hook is called, we call
client.emit('...')
, which will iterate through the array of hooks and call them all one at a time.This is special case - but we need this to unblock profiling so let's . We keep these APIs completely internal, we can change it later on.
BaseClient
andClient
type #7343Stretch
Send profiling + transactions in the same envelope
createEnvelope
) intransaction.finish
The text was updated successfully, but these errors were encountered: