Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MultiSpanProcessor.php

class MultiSpanProcessor

Class SpanMultiProcessor is a SpanProcessor that forwards all events to an array of SpanProcessors.

Hierarchy

  • class \OpenTelemetry\SDK\Trace\SpanProcessor\MultiSpanProcessor implements \OpenTelemetry\SDK\Trace\SpanProcessorInterface

Expanded class hierarchy of MultiSpanProcessor

1 file declares its use of MultiSpanProcessor
TracerSharedState.php in vendor/open-telemetry/sdk/Trace/TracerSharedState.php

File

vendor/open-telemetry/sdk/Trace/SpanProcessor/MultiSpanProcessor.php, line 17

Namespace

OpenTelemetry\SDK\Trace\SpanProcessor
View source
final class MultiSpanProcessor implements SpanProcessorInterface {
    
    /** @var list<SpanProcessorInterface> */
    private array $processors = [];
    public function __construct(SpanProcessorInterface ...$spanProcessors) {
        foreach ($spanProcessors as $processor) {
            $this->addSpanProcessor($processor);
        }
    }
    public function addSpanProcessor(SpanProcessorInterface $processor) : void {
        $this->processors[] = $processor;
    }
    
    /** @return list<SpanProcessorInterface> */
    public function getSpanProcessors() : array {
        return $this->processors;
    }
    
    /** @inheritDoc */
    public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext) : void {
        foreach ($this->processors as $processor) {
            $processor->onStart($span, $parentContext);
        }
    }
    
    /** @inheritDoc */
    public function onEnd(ReadableSpanInterface $span) : void {
        foreach ($this->processors as $processor) {
            $processor->onEnd($span);
        }
    }
    
    /** @inheritDoc */
    public function shutdown(?CancellationInterface $cancellation = null) : bool {
        $result = true;
        foreach ($this->processors as $processor) {
            $result = $result && $processor->shutdown();
        }
        return $result;
    }
    
    /** @inheritDoc */
    public function forceFlush(?CancellationInterface $cancellation = null) : bool {
        $result = true;
        foreach ($this->processors as $processor) {
            $result = $result && $processor->forceFlush();
        }
        return $result;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MultiSpanProcessor::$processors private property @var list&lt;SpanProcessorInterface&gt;
MultiSpanProcessor::addSpanProcessor public function
MultiSpanProcessor::forceFlush public function @inheritDoc Overrides SpanProcessorInterface::forceFlush
MultiSpanProcessor::getSpanProcessors public function
MultiSpanProcessor::onEnd public function @inheritDoc Overrides SpanProcessorInterface::onEnd
MultiSpanProcessor::onStart public function @inheritDoc Overrides SpanProcessorInterface::onStart
MultiSpanProcessor::shutdown public function @inheritDoc Overrides SpanProcessorInterface::shutdown
MultiSpanProcessor::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal