class ExporterFactory
Same name in this branch
- 11.1.x vendor/open-telemetry/sdk/Logs/ExporterFactory.php \OpenTelemetry\SDK\Logs\ExporterFactory
Hierarchy
- class \OpenTelemetry\SDK\Trace\ExporterFactory
Expanded class hierarchy of ExporterFactory
1 file declares its use of ExporterFactory
- SdkAutoloader.php in vendor/
open-telemetry/ sdk/ SdkAutoloader.php
File
-
vendor/
open-telemetry/ sdk/ Trace/ ExporterFactory.php, line 13
Namespace
OpenTelemetry\SDK\TraceView source
class ExporterFactory {
/**
* @throws RuntimeException
*/
public function create() : ?SpanExporterInterface {
$exporters = Configuration::getList(Variables::OTEL_TRACES_EXPORTER);
if (1 !== count($exporters)) {
throw new InvalidArgumentException(sprintf('Configuration %s requires exactly 1 exporter', Variables::OTEL_TRACES_EXPORTER));
}
$exporter = $exporters[0];
if ($exporter === 'none') {
return null;
}
$factory = Registry::spanExporterFactory($exporter);
return $factory->create();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ExporterFactory::create | public | function |