Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PropagatorFactory.php

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\Propagation
View 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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal