class SpanProcessorFactory
Hierarchy
- class \OpenTelemetry\SDK\Trace\SpanProcessorFactory
Expanded class hierarchy of SpanProcessorFactory
1 file declares its use of SpanProcessorFactory
- SdkAutoloader.php in vendor/
open-telemetry/ sdk/ SdkAutoloader.php
File
-
vendor/
open-telemetry/ sdk/ Trace/ SpanProcessorFactory.php, line 18
Namespace
OpenTelemetry\SDK\TraceView source
class SpanProcessorFactory {
public function create(?SpanExporterInterface $exporter = null, ?MeterProviderInterface $meterProvider = null) : SpanProcessorInterface {
if ($exporter === null) {
return new NoopSpanProcessor();
}
$name = Configuration::getEnum(Env::OTEL_PHP_TRACES_PROCESSOR);
return match ($name) { Values::VALUE_BATCH => new BatchSpanProcessor($exporter, Clock::getDefault(), Configuration::getInt(Env::OTEL_BSP_MAX_QUEUE_SIZE, BatchSpanProcessor::DEFAULT_MAX_QUEUE_SIZE), Configuration::getInt(Env::OTEL_BSP_SCHEDULE_DELAY, BatchSpanProcessor::DEFAULT_SCHEDULE_DELAY), Configuration::getInt(Env::OTEL_BSP_EXPORT_TIMEOUT, BatchSpanProcessor::DEFAULT_EXPORT_TIMEOUT), Configuration::getInt(Env::OTEL_BSP_MAX_EXPORT_BATCH_SIZE, BatchSpanProcessor::DEFAULT_MAX_EXPORT_BATCH_SIZE), true, $meterProvider ?? new NoopMeterProvider()),
Values::VALUE_SIMPLE => new SimpleSpanProcessor($exporter),
Values::VALUE_NOOP, Values::VALUE_NONE => NoopSpanProcessor::getInstance(),
default => throw new InvalidArgumentException('Unknown processor: ' . $name),
};
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SpanProcessorFactory::create | public | function |