File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/core/src/tracing Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ The transaction will not be sampled. Please use the ${configInstrumenter} instru
186186 if ( transaction . sampled ) {
187187 transaction . initSpanRecorder ( options . _experiments && ( options . _experiments . maxSpans as number ) ) ;
188188 }
189+ if ( client ) {
190+ client . emit ( 'startTransaction' , transaction ) ;
191+ }
189192 return transaction ;
190193}
191194
@@ -213,6 +216,9 @@ export function startIdleTransaction(
213216 if ( transaction . sampled ) {
214217 transaction . initSpanRecorder ( options . _experiments && ( options . _experiments . maxSpans as number ) ) ;
215218 }
219+ if ( client && client . emit ) {
220+ client . emit ( 'startTransaction' , transaction ) ;
221+ }
216222 return transaction ;
217223}
218224
Original file line number Diff line number Diff line change @@ -141,11 +141,15 @@ export class Transaction extends SpanClass implements TransactionInterface {
141141 // just sets the end timestamp
142142 super . finish ( endTimestamp ) ;
143143
144+ const client = this . _hub . getClient ( ) ;
145+ if ( client && client . emit ) {
146+ client . emit ( 'finishTransaction' , this ) ;
147+ }
148+
144149 if ( this . sampled !== true ) {
145150 // At this point if `sampled !== true` we want to discard the transaction.
146151 __DEBUG_BUILD__ && logger . log ( '[Tracing] Discarding transaction because its trace was not chosen to be sampled.' ) ;
147152
148- const client = this . _hub . getClient ( ) ;
149153 if ( client ) {
150154 client . recordDroppedEvent ( 'sample_rate' , 'transaction' ) ;
151155 }
You can’t perform that action at this time.
0 commit comments