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

Breadcrumb

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

function TracerProviderFactory::create

File

vendor/open-telemetry/sdk/Trace/TracerProviderFactory.php, line 21

Class

TracerProviderFactory

Namespace

OpenTelemetry\SDK\Trace

Code

public function create() : TracerProviderInterface {
    if (Sdk::isDisabled()) {
        return new NoopTracerProvider();
    }
    try {
        $exporter = $this->exporterFactory
            ->create();
    } catch (\Throwable $t) {
        self::logWarning('Unable to create exporter', [
            'exception' => $t,
        ]);
        $exporter = null;
    }
    try {
        $sampler = $this->samplerFactory
            ->create();
    } catch (\Throwable $t) {
        self::logWarning('Unable to create sampler', [
            'exception' => $t,
        ]);
        $sampler = null;
    }
    try {
        $spanProcessor = $this->spanProcessorFactory
            ->create($exporter);
    } catch (\Throwable $t) {
        self::logWarning('Unable to create span processor', [
            'exception' => $t,
        ]);
        $spanProcessor = null;
    }
    return new TracerProvider($spanProcessor, $sampler);
}

API Navigation

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