Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/observability / / withCurrentSpan
Function: withCurrentSpan()
ts
function withCurrentSpan<R>(span, fn): R | Promise<R>;Defined in: packages/observability/src/logger/logger.ts:63
Run fn with the supplied span as the "current" log-correlation span. The logger picks up the trace + span ids automatically.
Type Parameters
| Type Parameter |
|---|
R |
Parameters
| Parameter | Type |
|---|---|
span | | AISpan<SpanType> | undefined |
fn | () => R | Promise<R> |
Returns
R | Promise<R>