withSpan
withSpan<
T>(name,fn,attributes?,parent?):Promise<T>
Defined in: tracing.ts:31
Run fn inside an internal span.
On throw the span records the exception, is marked ERROR, and the error
is rethrown — mirroring the pino { err } convention.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
Span name (domain.operation, never a high-cardinality value).
(span) => Promise<T>
Work to run with the span active.
attributes?
Section titled “attributes?”Attributes
Fixed span attributes (no high-cardinality values in names).
parent?
Section titled “parent?”Context
Parent context (defaults to the active context).
Returns
Section titled “Returns”Promise<T>
Whatever fn returns.