Skip to content

Commit 2c2f6cf

Browse files
committed
align with OTEL Api and return this
1 parent 561536e commit 2c2f6cf

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/core/src/tracing/span.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ export class Span implements SpanInterface {
277277
/**
278278
* @inheritDoc
279279
*/
280-
public updateName(name: string): void {
280+
public updateName(name: string): this {
281281
this.description = name;
282+
return this;
282283
}
283284

284285
/**

packages/core/src/tracing/transaction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ export class Transaction extends SpanClass implements TransactionInterface {
101101
}
102102

103103
/** @inheritdoc */
104-
public updateName(name: string): void {
104+
public updateName(name: string): this {
105105
this._name = name;
106+
return this;
106107
}
107108

108109
/**

packages/types/src/span.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export interface Span extends SpanContext {
212212
/**
213213
* Update the name of the span.
214214
*/
215-
updateName(name: string): void;
215+
updateName(name: string): this;
216216

217217
/**
218218
* Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.

0 commit comments

Comments
 (0)