File tree 2 files changed +11
-1
lines changed
packages/core/src/tracing
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
186
186
if ( transaction . sampled ) {
187
187
transaction . initSpanRecorder ( options . _experiments && ( options . _experiments . maxSpans as number ) ) ;
188
188
}
189
+ if ( client ) {
190
+ client . emit ( 'startTransaction' , transaction ) ;
191
+ }
189
192
return transaction ;
190
193
}
191
194
@@ -213,6 +216,9 @@ export function startIdleTransaction(
213
216
if ( transaction . sampled ) {
214
217
transaction . initSpanRecorder ( options . _experiments && ( options . _experiments . maxSpans as number ) ) ;
215
218
}
219
+ if ( client && client . emit ) {
220
+ client . emit ( 'startTransaction' , transaction ) ;
221
+ }
216
222
return transaction ;
217
223
}
218
224
Original file line number Diff line number Diff line change @@ -141,11 +141,15 @@ export class Transaction extends SpanClass implements TransactionInterface {
141
141
// just sets the end timestamp
142
142
super . finish ( endTimestamp ) ;
143
143
144
+ const client = this . _hub . getClient ( ) ;
145
+ if ( client && client . emit ) {
146
+ client . emit ( 'finishTransaction' , this ) ;
147
+ }
148
+
144
149
if ( this . sampled !== true ) {
145
150
// At this point if `sampled !== true` we want to discard the transaction.
146
151
__DEBUG_BUILD__ && logger . log ( '[Tracing] Discarding transaction because its trace was not chosen to be sampled.' ) ;
147
152
148
- const client = this . _hub . getClient ( ) ;
149
153
if ( client ) {
150
154
client . recordDroppedEvent ( 'sample_rate' , 'transaction' ) ;
151
155
}
You can’t perform that action at this time.
0 commit comments