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

Breadcrumb

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

class LateBindingTracerProvider

Late binding providers are designed to be used by Instrumentation, while we do not have control over when all components (propagators, etc) which are registered through composer.autoload.files are actually loaded. It means that tracers etc are not fetched from Globals until the last possible instant (ie, when they try to create a span, get an instrument, etc). In the future, when everything uses SPI, this will be removed.

Hierarchy

  • class \OpenTelemetry\API\Trace\LateBindingTracerProvider implements \OpenTelemetry\API\Trace\TracerProviderInterface

Expanded class hierarchy of LateBindingTracerProvider

1 file declares its use of LateBindingTracerProvider
SdkAutoloader.php in vendor/open-telemetry/sdk/SdkAutoloader.php

File

vendor/open-telemetry/api/Trace/LateBindingTracerProvider.php, line 15

Namespace

OpenTelemetry\API\Trace
View source
class LateBindingTracerProvider implements TracerProviderInterface {
    private ?TracerProviderInterface $tracerProvider = null;
    
    /** @param Closure(): TracerProviderInterface $factory */
    public function __construct(Closure $factory) {
    }
    public function getTracer(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []) : TracerInterface {
        return $this->tracerProvider?->getTracer($name, $version, $schemaUrl, $attributes) ?? new LateBindingTracer(fn(): TracerInterface => ($this->tracerProvider ??= ($this->factory)())
            ->getTracer($name, $version, $schemaUrl, $attributes));
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
LateBindingTracerProvider::$tracerProvider private property
LateBindingTracerProvider::getTracer public function Overrides TracerProviderInterface::getTracer
LateBindingTracerProvider::__construct public function

API Navigation

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