function Registry::spanExporterFactory
1 call to Registry::spanExporterFactory()
- ExporterFactory::create in vendor/
open-telemetry/ sdk/ Trace/ ExporterFactory.php
File
-
vendor/
open-telemetry/ sdk/ Registry.php, line 127
Class
- Registry
- A registry to enable central registration of components that the SDK requires but which may be provided by non-SDK modules, such as contrib and extension. @todo [breaking] deprecate this mechanism of setting up components, in favor of using SPI.
Namespace
OpenTelemetry\SDKCode
public static function spanExporterFactory(string $exporter) : SpanExporterFactoryInterface {
if (!array_key_exists($exporter, self::$spanExporterFactories)) {
throw new RuntimeException('Span exporter factory not defined for: ' . $exporter);
}
$class = self::$spanExporterFactories[$exporter];
$factory = is_callable($class) ? $class : new $class();
assert($factory instanceof SpanExporterFactoryInterface);
return $factory;
}