diff --git a/packages/core/src/tracing/span.ts b/packages/core/src/tracing/span.ts index 4dec7f043010..29584f65858d 100644 --- a/packages/core/src/tracing/span.ts +++ b/packages/core/src/tracing/span.ts @@ -277,8 +277,9 @@ export class Span implements SpanInterface { /** * @inheritDoc */ - public updateName(name: string): void { + public updateName(name: string): this { this.description = name; + return this; } /** diff --git a/packages/core/src/tracing/transaction.ts b/packages/core/src/tracing/transaction.ts index ea8b1050a86d..cc5877b04dca 100644 --- a/packages/core/src/tracing/transaction.ts +++ b/packages/core/src/tracing/transaction.ts @@ -101,8 +101,9 @@ export class Transaction extends SpanClass implements TransactionInterface { } /** @inheritdoc */ - public updateName(name: string): void { + public updateName(name: string): this { this._name = name; + return this; } /** diff --git a/packages/types/src/span.ts b/packages/types/src/span.ts index bf44a9618ced..95a1b0e9315b 100644 --- a/packages/types/src/span.ts +++ b/packages/types/src/span.ts @@ -212,7 +212,7 @@ export interface Span extends SpanContext { /** * Update the name of the span. */ - updateName(name: string): void; + updateName(name: string): this; /** * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.