Skip to content
English

RecordedSpan

RecordedSpan = object

Defined in: src/tracing/RecordingTracer.ts:37

Reference Tracer implementation. Generates real ids, tracks span hierarchy via parent context, propagates the active span through AsyncLocalStorage, and records ended spans into an in-memory buffer for assertions.

Production usage: the recorder list is your sink. For full OpenTelemetry export, pass each completed span through to the OTel SDK in onSpanEnd — or write a thin adapter that delegates the Tracer calls to @opentelemetry/api.trace.getTracer(...).

This impl is not an OpenTelemetry SDK — it doesn’t sample, batch, or export. Its role is the in-process backbone for actor-ts’s instrumentation; the SDK boundary lives in the adapter layer.

readonly attributes: Readonly<Record<string, AttributeValue>>

Defined in: src/tracing/RecordingTracer.ts:57


readonly context: SpanContext

Defined in: src/tracing/RecordingTracer.ts:40


readonly optional endHighResolutionMs?: number

Defined in: src/tracing/RecordingTracer.ts:56


readonly endTimeMs: number

Defined in: src/tracing/RecordingTracer.ts:43


readonly exceptions: ReadonlyArray<Error>

Defined in: src/tracing/RecordingTracer.ts:60


readonly kind: SpanKind

Defined in: src/tracing/RecordingTracer.ts:39


readonly name: string

Defined in: src/tracing/RecordingTracer.ts:38


readonly parent: SpanContext | null

Defined in: src/tracing/RecordingTracer.ts:41


readonly optional startHighResolutionMs?: number

Defined in: src/tracing/RecordingTracer.ts:55

Monotonic-clock start, in fractional milliseconds.

startTimeMs/endTimeMs are wall clock, which is what an exporter needs but too coarse to lay out a flame graph: actor message handling routinely completes inside a single millisecond, so every bar would be zero-width. These two are taken from the same high-resolution clock the benchmarks use. Absent when the caller supplied explicit timestamps — there is no honest way to invent a monotonic reading for a time someone else chose.


readonly startTimeMs: number

Defined in: src/tracing/RecordingTracer.ts:42


readonly status: SpanStatus

Defined in: src/tracing/RecordingTracer.ts:58


readonly optional statusMessage?: string

Defined in: src/tracing/RecordingTracer.ts:59