Skip to content

Commit 3bedc17

Browse files
committed
feat(types): Add TransactionNameChange interface
1 parent 249e64d commit 3bedc17

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

packages/tracing/src/transaction.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class Transaction extends SpanClass implements TransactionInterface {
4545
this.metadata = {
4646
...transactionContext.metadata,
4747
spanMetadata: {},
48+
nameChanges: [],
49+
propogations: 0,
4850
};
4951

5052
this._trimEnd = transactionContext.trimEnd;

packages/types/src/event.ts

Lines changed: 3 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,8 @@ export interface Event {
4949
sdkProcessingMetadata?: { [key: string]: any };
5050
transaction_info?: {
5151
source: TransactionSource;
52+
name_changes: TransactionNameChange[];
53+
propagations: number;
5254
};
5355
}
5456

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: 23 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+
propagations: number;
153159
}
154160

155161
/**
@@ -169,3 +175,20 @@ 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+
/**
184+
* Unix timestamp when the name was changed. Same type as the start and
185+
* end timestamps of a transaction and span.
186+
*/
187+
timestamp: number;
188+
189+
/** New source applied for transaction name change */
190+
source: TransactionSource;
191+
192+
/** Number of propogations since start of transaction */
193+
propagations: number;
194+
}

0 commit comments

Comments
 (0)