Skip to content

Commit a746f1a

Browse files
author
Jack Englund
committed
Fix types for name in /tracing/transactions.ts
1 parent f89a842 commit a746f1a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/tracing/src/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Span as SpanClass, SpanRecorder } from './span';
1212

1313
/** JSDoc */
1414
export class Transaction extends SpanClass implements TransactionInterface {
15-
public name: string;
15+
public name: string | Symbol;
1616

1717
public metadata: TransactionMetadata;
1818

@@ -51,7 +51,7 @@ export class Transaction extends SpanClass implements TransactionInterface {
5151
/**
5252
* JSDoc
5353
*/
54-
public setName(name: string): void {
54+
public setName(name: string | Symbol): void {
5555
this.name = name;
5656
}
5757

@@ -142,7 +142,7 @@ export class Transaction extends SpanClass implements TransactionInterface {
142142
transaction.measurements = this._measurements;
143143
}
144144

145-
logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);
145+
logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name.toString()}.`);
146146

147147
return this._hub.captureEvent(transaction);
148148
}

packages/types/src/event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface Event {
2828
environment?: string;
2929
sdk?: SdkInfo;
3030
request?: Request;
31-
transaction?: string;
31+
transaction?: string | Symbol;
3232
modules?: { [key: string]: string };
3333
fingerprint?: string[];
3434
exception?: {
@@ -37,7 +37,7 @@ export interface Event {
3737
stacktrace?: Stacktrace;
3838
breadcrumbs?: Breadcrumb[];
3939
contexts?: Contexts;
40-
tags?: { [key: string]: Primitive };
40+
tags?: { [key: string]: Primitive | Symbol };
4141
extra?: Extras;
4242
user?: User;
4343
type?: EventType;

packages/types/src/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface TransactionContext extends SpanContext {
88
/**
99
* Human-readable identifier for the transaction
1010
*/
11-
name: string;
11+
name: string | Symbol;
1212

1313
/**
1414
* If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
@@ -56,7 +56,7 @@ export interface Transaction extends TransactionContext, Span {
5656
/**
5757
* @inheritDoc
5858
*/
59-
tags: { [key: string]: Primitive };
59+
tags: { [key: string]: Primitive | Symbol };
6060

6161
/**
6262
* @inheritDoc
@@ -71,7 +71,7 @@ export interface Transaction extends TransactionContext, Span {
7171
/**
7272
* Set the name of the transaction
7373
*/
74-
setName(name: string): void;
74+
setName(name: string | Symbol): void;
7575

7676
/** Returns the current transaction properties as a `TransactionContext` */
7777
toContext(): TransactionContext;

0 commit comments

Comments
 (0)