Skip to content

Commit 68d6eba

Browse files
committed
add interfaces for transaction name change
1 parent 781485e commit 68d6eba

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

packages/types/src/event.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CaptureContext } from './scope';
1111
import { SdkInfo } from './sdkinfo';
1212
import { Severity, SeverityLevel } from './severity';
1313
import { Span } from './span';
14-
import { TransactionSource } from './transaction';
14+
import { TransactionNameChange, TransactionSource } from './transaction';
1515
import { User } from './user';
1616

1717
/** JSDoc */
@@ -49,6 +49,9 @@ export interface Event {
4949
sdkProcessingMetadata?: { [key: string]: any };
5050
transaction_info?: {
5151
source: TransactionSource;
52+
name_changes: TransactionNameChange[];
53+
// The total number of propagations that happened
54+
num_propagations: number;
5255
};
5356
}
5457

packages/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export type {
7373
TransactionMetadata,
7474
TransactionSamplingMethod,
7575
TransactionSource,
76+
TransactionNameChange,
7677
} from './transaction';
7778
export type {
7879
DurationUnit,

packages/types/src/transaction.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ export interface TransactionMetadata {
150150

151151
/** Metadata for the transaction's spans, keyed by spanId */
152152
spanMetadata: { [spanId: string]: { [key: string]: unknown } };
153+
154+
/** Metadata representing information about transaction name changes */
155+
nameChanges: TransactionNameChange[];
156+
157+
/** The total number of propagations that happened */
158+
numPropagations: number;
153159
}
154160

155161
/**
@@ -169,3 +175,17 @@ export type TransactionSource =
169175
| 'component'
170176
/** Name of a background task (e.g. a Celery task) */
171177
| 'task';
178+
179+
/**
180+
* Object representing metadata about when a transaction name was changed.
181+
*/
182+
export interface TransactionNameChange {
183+
// new name
184+
name: string;
185+
// unix timestamp when the name was changed
186+
timestamp: number;
187+
// new source
188+
source: TransactionSource;
189+
// number of propagations since start of transaction.
190+
propagations: number;
191+
}

0 commit comments

Comments
 (0)