function InstrumentationTrait::setTracerProvider
File
-
vendor/
open-telemetry/ api/ Instrumentation/ InstrumentationTrait.php, line 129
Class
- InstrumentationTrait
- This trait in conjunction with the InstrumentationInterface is meant as a base for instrumentations for the OpenTelemetry API. Instrumentations need to implement the abstract methods of this trait (besides any instrumentation specific code)
Namespace
OpenTelemetry\API\InstrumentationCode
public function setTracerProvider(TracerProviderInterface $tracerProvider) : void {
$this->tracerProvider = $tracerProvider;
// @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/trace/api.md#get-a-tracer
$this->tracer = $tracerProvider->getTracer($this->getName(), $this->getVersion(), $this->getSchemaUrl());
}