Skip to content

Commit

Permalink
feat(tracing): Make setMeasurement public API (#4933)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored and AbhiPrasad committed May 30, 2022
1 parent c8fb2fc commit d9ce51f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 1 addition & 6 deletions packages/tracing/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ export class Transaction extends SpanClass implements TransactionInterface {
}

/**
* Set observed measurement for this transaction.
*
* @param name Name of the measurement
* @param value Value of the measurement
* @param unit Unit of the measurement. (Defaults to an empty string)
* @hidden
* @inheritDoc
*/
public setMeasurement(name: string, value: number, unit: string = ''): void {
this._measurements[name] = { value, unit };
Expand Down
9 changes: 9 additions & 0 deletions packages/types/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ export interface Transaction extends TransactionContext, Span {
*/
setName(name: string): void;

/**
* Set observed measurement for this transaction.
*
* @param name Name of the measurement
* @param value Value of the measurement
* @param unit Unit of the measurement. (Defaults to an empty string)
*/
setMeasurement(name: string, value: number, unit: string): void;

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

Expand Down

0 comments on commit d9ce51f

Please sign in to comment.