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

Breadcrumb

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

function BatchSpanProcessor::onEnd

Overrides SpanProcessorInterface::onEnd

File

vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php, line 146

Class

BatchSpanProcessor

Namespace

OpenTelemetry\SDK\Trace\SpanProcessor

Code

public function onEnd(ReadableSpanInterface $span) : void {
    if ($this->closed) {
        return;
    }
    if (!$span->getContext()
        ->isSampled()) {
        return;
    }
    if ($this->queueSize === $this->maxQueueSize) {
        $this->dropped++;
        return;
    }
    $this->queueSize++;
    $this->batch[] = $span->toSpanData();
    $this->nextScheduledRun ??= $this->clock
        ->now() + $this->scheduledDelayNanos;
    if (count($this->batch) === $this->maxExportBatchSize) {
        $this->enqueueBatch();
    }
    if ($this->autoFlush) {
        $this->flush();
    }
}

API Navigation

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