OpenTelemetry SDK
    Preparing search index...

    Interface SpanProcessor

    SpanProcessor is the interface Tracer SDK uses to allow synchronous hooks for when a Span is started or when a Span is ended.

    interface SpanProcessor {
        forceFlush(): Promise<void>;
        onEnd(span: node.ReadableSpan): void;
        onEnding?(span: node.Span): void;
        onStart(span: node.Span, parentContext: @opentelemetry/api.Context): void;
        shutdown(): Promise<void>;
    }

    Implemented by

    Index
    • Forces to export all finished spans

      Returns Promise<void>

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

      Parameters

      Returns void

    • Experimental

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

      Parameters

      • span: node.Span

        the Span that is ending.

        This method is experimental and may break in minor versions of this package

      Returns void

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

      Returns Promise<void>