function Registry::metricExporterFactory
1 call to Registry::metricExporterFactory()
- MeterProviderFactory::create in vendor/
open-telemetry/ sdk/ Metrics/ MeterProviderFactory.php - @todo https://github.com/open-telemetry/opentelemetry-specification/blob/main…
File
-
vendor/
open-telemetry/ sdk/ Registry.php, line 168
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 metricExporterFactory(string $exporter) : MetricExporterFactoryInterface {
if (!array_key_exists($exporter, self::$metricExporterFactories)) {
throw new RuntimeException('Metric exporter factory not registered for protocol: ' . $exporter);
}
$class = self::$metricExporterFactories[$exporter];
$factory = is_callable($class) ? $class : new $class();
assert($factory instanceof MetricExporterFactoryInterface);
return $factory;
}