config = $config; $this->logger = $logger; $this->cache = $cache; } public function make(string $name): Tracer { $this->prefix = "opentracing.tracer.{$name}."; [$name, $options] = $this->parseConfig(); $jaegerConfig = new Config( $options, $name, $this->logger, $this->cache ); return $jaegerConfig->initializeTracer(); } private function parseConfig(): array { return [ $this->getConfig('name', 'skeleton'), $this->getConfig('options', [ 'sampler' => [ 'type' => SAMPLER_TYPE_CONST, 'param' => true, ], 'logging' => false, ]), ]; } private function getConfig(string $key, $default) { return $this->config->get($this->prefix . $key, $default); } }