class PropagatorFactory
Hierarchy
- class \OpenTelemetry\SDK\Propagation\PropagatorFactory uses \OpenTelemetry\API\Behavior\LogsMessagesTrait
Expanded class hierarchy of PropagatorFactory
1 file declares its use of PropagatorFactory
- SdkAutoloader.php in vendor/
open-telemetry/ sdk/ SdkAutoloader.php
File
-
vendor/
open-telemetry/ sdk/ Propagation/ PropagatorFactory.php, line 15
Namespace
OpenTelemetry\SDK\PropagationView source
class PropagatorFactory {
use LogsMessagesTrait;
public function create() : TextMapPropagatorInterface {
$propagators = Configuration::getList(Variables::OTEL_PROPAGATORS);
return match (count($propagators)) { 0 => new NoopTextMapPropagator(),
1 => $this->buildPropagator($propagators[0]),
default => new MultiTextMapPropagator($this->buildPropagators($propagators)),
};
}
/**
* @return list<TextMapPropagatorInterface>
*/
private function buildPropagators(array $names) : array {
$propagators = [];
foreach ($names as $name) {
$propagators[] = $this->buildPropagator($name);
}
return $propagators;
}
private function buildPropagator(string $name) : TextMapPropagatorInterface {
try {
return Registry::textMapPropagator($name);
} catch (\RuntimeException $e) {
self::logWarning($e->getMessage());
}
return NoopTextMapPropagator::getInstance();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
LogsMessagesTrait::doLog | private static | function | |
LogsMessagesTrait::logDebug | protected static | function | |
LogsMessagesTrait::logError | protected static | function | |
LogsMessagesTrait::logInfo | protected static | function | |
LogsMessagesTrait::logNotice | protected static | function | |
LogsMessagesTrait::logWarning | protected static | function | |
LogsMessagesTrait::shouldLog | private static | function | |
PropagatorFactory::buildPropagator | private | function | |
PropagatorFactory::buildPropagators | private | function | |
PropagatorFactory::create | public | function |