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

Breadcrumb

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

trait SpanExporterTrait

Hierarchy

  • trait \OpenTelemetry\SDK\Trace\Behavior\SpanExporterTrait
2 files declare their use of SpanExporterTrait
InMemoryExporter.php in vendor/open-telemetry/sdk/Trace/SpanExporter/InMemoryExporter.php
LoggerExporter.php in vendor/open-telemetry/sdk/Trace/SpanExporter/LoggerExporter.php

File

vendor/open-telemetry/sdk/Trace/Behavior/SpanExporterTrait.php, line 12

Namespace

OpenTelemetry\SDK\Trace\Behavior
View source
trait SpanExporterTrait {
    private bool $running = true;
    
    /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#shutdown-2 */
    public function shutdown(?CancellationInterface $cancellation = null) : bool {
        $this->running = false;
        return true;
    }
    
    /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#forceflush-2 */
    public function forceFlush(?CancellationInterface $cancellation = null) : bool {
        return true;
    }
    
    /**
     * @param iterable<SpanDataInterface> $batch
     * @return FutureInterface<bool>
     */
    public function export(iterable $batch, ?CancellationInterface $cancellation = null) : FutureInterface {
        if (!$this->running) {
            return new CompletedFuture(false);
        }
        return new CompletedFuture($this->doExport($batch));
        
        /** @phpstan-ignore-line */
    }
    
    /**
     * @param iterable<SpanDataInterface> $spans Batch of spans to export
     */
    protected abstract function doExport(iterable $spans) : bool;
    
    /** @phpstan-ignore-line */

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SpanExporterTrait::$running private property
SpanExporterTrait::doExport abstract protected function 2
SpanExporterTrait::export public function
SpanExporterTrait::forceFlush public function @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#forceflush-2
SpanExporterTrait::shutdown public function @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#shutdown-2

API Navigation

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