Share via


OpenTelemetryScope class

Base class for OpenTelemetry tracing scopes

Methods

dispose()

Legacy dispose method for compatibility

recordError(Error)

Records an error that occurred during the operation

withActiveSpanAsync<T>(() => Promise<T>)

Makes this span active for the duration of the async callback execution

Method Details

dispose()

Legacy dispose method for compatibility

function dispose()

recordError(Error)

Records an error that occurred during the operation

function recordError(error: Error)

Parameters

error

Error

The error that occurred

withActiveSpanAsync<T>(() => Promise<T>)

Makes this span active for the duration of the async callback execution

function withActiveSpanAsync<T>(callback: () => Promise<T>): Promise<T>

Parameters

callback

() => Promise<T>

Returns

Promise<T>