Skip to content

Commit 5c28e06

Browse files
committed
record name changes with the scope
1 parent d16a353 commit 5c28e06

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/hub/src/scope.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
isThenable,
3030
logger,
3131
SyncPromise,
32+
timestampWithMs,
3233
} from '@sentry/utils';
3334

3435
import { updateSession } from './session';
@@ -466,6 +467,23 @@ export class Scope implements ScopeInterface {
466467
}
467468
if (this._transactionName) {
468469
event.transaction = this._transactionName;
470+
const transactionInfo = event.transaction_info;
471+
if (transactionInfo) {
472+
const source = 'custom';
473+
event.transaction_info = {
474+
...transactionInfo,
475+
source,
476+
name_changes: [
477+
...transactionInfo.name_changes,
478+
{
479+
name: this._transactionName,
480+
source,
481+
timestamp: timestampWithMs(),
482+
propagations: transactionInfo.num_propagations,
483+
},
484+
],
485+
};
486+
}
469487
}
470488

471489
// We want to set the trace context for normal events only if there isn't already

0 commit comments

Comments
 (0)