Skip to content

Commit

Permalink
align with OTEL Api and return this
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jan 3, 2024
1 parent 561536e commit 2c2f6cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/tracing/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/tracing/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 2c2f6cf

Please sign in to comment.