File tree 2 files changed +25
-0
lines changed 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
35
35
SyncPromise ,
36
36
truncate ,
37
37
uuid4 ,
38
+ timestampInSeconds ,
38
39
} from '@sentry/utils' ;
39
40
40
41
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api' ;
@@ -653,6 +654,29 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
653
654
throw new SentryError ( '`beforeSend` returned `null`, will not send event.' , 'log' ) ;
654
655
}
655
656
657
+ const transactionInfo = processedEvent . transaction_info ;
658
+ if (
659
+ processedEvent . type === 'transaction' &&
660
+ transactionInfo &&
661
+ processedEvent . transaction &&
662
+ processedEvent . transaction !== event . transaction
663
+ ) {
664
+ const source = 'custom' ;
665
+ event . transaction_info = {
666
+ ...transactionInfo ,
667
+ source,
668
+ name_changes : [
669
+ ...transactionInfo . name_changes ,
670
+ {
671
+ name : processedEvent . transaction ,
672
+ source,
673
+ timestamp : timestampInSeconds ( ) ,
674
+ propagations : transactionInfo . num_propagations ,
675
+ } ,
676
+ ] ,
677
+ } ;
678
+ }
679
+
656
680
const session = scope && scope . getSession ( ) ;
657
681
if ( ! isTransaction && session ) {
658
682
this . _updateSessionFromEvent ( session , processedEvent ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import {
29
29
isThenable ,
30
30
logger ,
31
31
SyncPromise ,
32
+ timestampWithMs ,
32
33
} from '@sentry/utils' ;
33
34
34
35
import { updateSession } from './session' ;
You can’t perform that action at this time.
0 commit comments