Skip to main content

withSpanSync()

function withSpanSync\<T\>(
name: string,
fn: (span: Span) => T,
attributes?: Attributes): T;

Defined in: src/lib/logging/context.ts:344

Synchronous version of withSpan for non-async operations.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
namestringName for the span.
fn(span: Span) => TFunction to execute within the span.
attributes?AttributesOptional attributes for the span.

Returns

T

The result of the function.