Class MultiSpanProcessor

  • All Implemented Interfaces:
    ExtendedSpanProcessor, SpanProcessor, java.io.Closeable, java.lang.AutoCloseable

    final class MultiSpanProcessor
    extends java.lang.Object
    implements ExtendedSpanProcessor
    Implementation of the SpanProcessor that simply forwards all received events to a list of SpanProcessors.
    • Field Detail

      • spanProcessorsStart

        private final java.util.List<SpanProcessor> spanProcessorsStart
      • spanProcessorsEnd

        private final java.util.List<SpanProcessor> spanProcessorsEnd
      • spanProcessorsAll

        private final java.util.List<SpanProcessor> spanProcessorsAll
      • isShutdown

        private final java.util.concurrent.atomic.AtomicBoolean isShutdown
    • Constructor Detail

      • MultiSpanProcessor

        private MultiSpanProcessor​(java.util.List<SpanProcessor> spanProcessors)
    • Method Detail

      • create

        static SpanProcessor create​(java.util.List<SpanProcessor> spanProcessorList)
        Creates a new MultiSpanProcessor.
        Parameters:
        spanProcessorList - the List of SpanProcessors.
        Returns:
        a new MultiSpanProcessor.
        Throws:
        java.lang.NullPointerException - if the spanProcessorList is null.
      • onStart

        public void onStart​(Context parentContext,
                            ReadWriteSpan readWriteSpan)
        Description copied from interface: SpanProcessor
        Called when a Span is started, if the Span.isRecording() returns true.

        This method is called synchronously on the execution thread, should not throw or block the execution thread.

        Specified by:
        onStart in interface SpanProcessor
        Parameters:
        parentContext - the parent Context of the span that just started.
        readWriteSpan - the Span that just started.
      • onEnd

        public void onEnd​(ReadableSpan readableSpan)
        Description copied from interface: SpanProcessor
        Called when a Span is ended, if the Span.isRecording() returns true.

        This method is called synchronously on the execution thread, should not throw or block the execution thread.

        Specified by:
        onEnd in interface SpanProcessor
        Parameters:
        readableSpan - the Span that just ended.
      • onEnding

        public void onEnding​(ReadWriteSpan span)
        Description copied from interface: ExtendedSpanProcessor
        Called when a Span is ended, but before SpanProcessor.onEnd(ReadableSpan) is invoked with an immutable variant of this span. This means that the span will still be mutable. Note that the span will only be modifiable synchronously from this callback, concurrent modifications from other threads will be prevented. Only called if Span.isRecording() returns true.

        This method is called synchronously on the execution thread, should not throw or block the execution thread.

        Specified by:
        onEnding in interface ExtendedSpanProcessor
        Parameters:
        span - the Span that is just about to be ended.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object