Skip to main content

startSpan()

function startSpan(
name: string,
attributes?: Attributes,
parentContext?: TraceContext): Span;

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

Starts a new span and pushes it onto the context stack.

Parameters

ParameterTypeDescription
namestringHuman-readable name for the span.
attributes?AttributesOptional attributes for the span.
parentContext?TraceContextOptional explicit parent context (uses current context if not provided).

Returns

Span

The created span.