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

Breadcrumb

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

function TracerProvider::__construct

Parameters

list<SpanProcessorInterface>|SpanProcessorInterface|null $spanProcessors :

File

vendor/open-telemetry/sdk/Trace/TracerProvider.php, line 28

Class

TracerProvider

Namespace

OpenTelemetry\SDK\Trace

Code

public function __construct(SpanProcessorInterface|array|null $spanProcessors = [], ?SamplerInterface $sampler = null, ?ResourceInfo $resource = null, ?SpanLimits $spanLimits = null, ?IdGeneratorInterface $idGenerator = null, ?InstrumentationScopeFactoryInterface $instrumentationScopeFactory = null, ?Configurator $configurator = null) {
    $spanProcessors ??= [];
    $spanProcessors = is_array($spanProcessors) ? $spanProcessors : [
        $spanProcessors,
    ];
    $resource ??= ResourceInfoFactory::defaultResource();
    $sampler ??= new ParentBased(new AlwaysOnSampler());
    $idGenerator ??= new RandomIdGenerator();
    $spanLimits ??= (new SpanLimitsBuilder())->build();
    $this->tracerSharedState = new TracerSharedState($idGenerator, $resource, $spanLimits, $sampler, $spanProcessors);
    $this->instrumentationScopeFactory = $instrumentationScopeFactory ?? new InstrumentationScopeFactory(Attributes::factory());
    $this->tracers = new WeakMap();
}

API Navigation

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