TracingExtension
Esta página aún no está disponible en tu idioma.
Defined in: src/tracing/TracingExtension.ts:14
system.extension(TracingExtensionId) accessor. Hands back the
currently-installed Tracer (defaults to the noop), so
framework instrumentation can call tracerOf(system).activeSpan()
etc. without conditional checks. Opt in by calling enable(tracer)
with either a RecordingTracer (for tests) or an adapter around
@opentelemetry/api’s tracer.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TracingExtension(
_system):TracingExtension
Defined in: src/tracing/TracingExtension.ts:17
Parameters
Section titled “Parameters”_system
Section titled “_system”Returns
Section titled “Returns”TracingExtension
Methods
Section titled “Methods”captureMessagePayloads()
Section titled “captureMessagePayloads()”captureMessagePayloads(
enabled):void
Defined in: src/tracing/TracingExtension.ts:70
Attach the message itself, as JSON, to every actor.receive span.
A span otherwise records only the message’s type, which answers
“what happened” but not “to what” — and for a kind-tagged object
literal the type alone is thin. The cost is a JSON.stringify per
traced message, bounded in depth and length, which is why it is a
separate switch from recordRootSpans rather than implied by
it.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
disable()
Section titled “disable()”disable():
void
Defined in: src/tracing/TracingExtension.ts:77
Reset back to the noop — primarily for tests.
Returns
Section titled “Returns”void
enable()
Section titled “enable()”enable(
tracer):Tracer
Defined in: src/tracing/TracingExtension.ts:24
Plug in a tracer. Idempotent if you re-pass the same instance.
Parameters
Section titled “Parameters”tracer
Section titled “tracer”Returns
Section titled “Returns”get():
Tracer
Defined in: src/tracing/TracingExtension.ts:21
Currently-installed tracer (noop until enable(...) is called).
Returns
Section titled “Returns”isCapturingMessagePayloads()
Section titled “isCapturingMessagePayloads()”isCapturingMessagePayloads():
boolean
Defined in: src/tracing/TracingExtension.ts:74
Returns
Section titled “Returns”boolean
isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Defined in: src/tracing/TracingExtension.ts:30
True if a real (non-noop) tracer is installed.
Returns
Section titled “Returns”boolean
isRecordingRootSpans()
Section titled “isRecordingRootSpans()”isRecordingRootSpans():
boolean
Defined in: src/tracing/TracingExtension.ts:58
Returns
Section titled “Returns”boolean
recordRootSpans()
Section titled “recordRootSpans()”recordRootSpans(
enabled):void
Defined in: src/tracing/TracingExtension.ts:49
Trace every message, not only the ones already inside a trace.
Normally an actor opens a span only when the message arrived with a
trace context or a span was active at the call site, which makes the
framework propagate-only: a plain ref.tell(…) from outside any
span produces nothing. That is the right default for production —
you decide what is worth a trace — but it means a tracing UI shows
an empty screen on a system that is plainly busy.
Switch this on and every message becomes a root span. Expect the volume to match the traffic; this is a debugging mode, not a sampling policy.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
Throws
Section titled “Throws”if no tracer is installed — root spans against the noop tracer would cost work and record nothing.
