Skip to content

Commit 9a0ab65

Browse files
committed
ref: Use previous source when logging name changes
1 parent ff4f97f commit 9a0ab65

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/tracing/src/transaction.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ export class Transaction extends SpanClass implements TransactionInterface {
7878
public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {
7979
// `source` could change without the name changing if we discover that an unparameterized route is actually
8080
// parameterized by virtue of having no parameters in its path
81-
if (name !== this.name || source !== this.metadata.source) {
81+
if (this.metadata.source && (name !== this.name || source !== this.metadata.source)) {
8282
this.metadata.changes.push({
83-
source,
83+
// log previous source
84+
source: this.metadata.source,
8485
timestamp: timestampInSeconds(),
8586
propagations: this.metadata.propagations,
8687
});

packages/types/src/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export interface TransactionNameChange {
186186
*/
187187
timestamp: number;
188188

189-
/** New source applied for transaction name change */
189+
/** Previous source before transaction name change */
190190
source: TransactionSource;
191191

192192
/** Number of propagations since start of transaction */

0 commit comments

Comments
 (0)