انتقل إلى المحتوى الرئيسي

Class: AllowlistSpanProcessor

Defined in: packages/telemetry/src/allowlist.ts:114

Rewrites every span as it ends, before any exporting processor sees it: attributes filtered to the allowlist and scrubbed, the span name scrubbed, the status message dropped (it is where an error's text lands), and the same applied to events and links. It must be registered BEFORE the exporting processor; startTelemetry does.

It rewrites in place because the processors that follow hold a reference to the same span object, and a copy would leave the original exported unfiltered.

Implements​

  • SpanProcessor

Constructors​

Constructor​

new AllowlistSpanProcessor(allowed?): AllowlistSpanProcessor

Defined in: packages/telemetry/src/allowlist.ts:118

Parameters​

allowed?​

ReadonlySet<string> = ALLOWED_SPAN_ATTRIBUTES

The keys that may stay. Defaults to ALLOWED_SPAN_ATTRIBUTES.

Returns​

AllowlistSpanProcessor

Methods​

forceFlush()​

forceFlush(): Promise<void>

Defined in: packages/telemetry/src/allowlist.ts:146

Forces to export all finished spans

Returns​

Promise<void>

Implementation of​

tracing.SpanProcessor.forceFlush


onEnd()​

onEnd(span): void

Defined in: packages/telemetry/src/allowlist.ts:124

Called when a ReadableSpan is ended, if the span.isRecording() returns true.

Parameters​

span​

ReadableSpan

the Span that just ended.

Returns​

void

Implementation of​

tracing.SpanProcessor.onEnd


onStart()​

onStart(): void

Defined in: packages/telemetry/src/allowlist.ts:122

Called when a Span is started, if the span.isRecording() returns true.

Returns​

void

Implementation of​

tracing.SpanProcessor.onStart


shutdown()​

shutdown(): Promise<void>

Defined in: packages/telemetry/src/allowlist.ts:150

Shuts down the processor. Called when SDK is shut down. This is an opportunity for processor to do any cleanup required.

Returns​

Promise<void>

Implementation of​

tracing.SpanProcessor.shutdown