function TracerProvider::getTracer
@inheritDoc
File
-
vendor/
open-telemetry/ sdk/ Trace/ TracerProvider.php, line 63
Class
Namespace
OpenTelemetry\SDK\TraceCode
public function getTracer(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []) : API\TracerInterface {
if ($this->tracerSharedState
->hasShutdown()) {
return NoopTracer::getInstance();
}
$scope = $this->instrumentationScopeFactory
->create($name, $version, $schemaUrl, $attributes);
$tracer = new Tracer($this->tracerSharedState, $scope, $this->configurator);
$this->tracers
->offsetSet($tracer, null);
return $tracer;
}