Skip to content

withTraceContext

function withTraceContext<T>(context, fn): T;

Runs a callback with a previously captured trace context.

Pass null or undefined to run the callback without any ambient trace context.

Type Parameter

T

Parameter Type

context

| Readonly<{ span?: | Span<any> | null; trace: Trace; }> | null | undefined

fn

() => T

T