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

Breadcrumb

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

function Configurator::storeInContext

Overrides ImplicitContextKeyedInterface::storeInContext

File

vendor/open-telemetry/api/Instrumentation/Configurator.php, line 66

Class

Configurator
Configures the global (context scoped) instrumentation instances.

Namespace

OpenTelemetry\API\Instrumentation

Code

public function storeInContext(?ContextInterface $context = null) : ContextInterface {
    $context ??= Context::getCurrent();
    if ($this->tracerProvider !== null) {
        $context = $context->with(ContextKeys::tracerProvider(), $this->tracerProvider);
    }
    if ($this->meterProvider !== null) {
        $context = $context->with(ContextKeys::meterProvider(), $this->meterProvider);
    }
    if ($this->propagator !== null) {
        $context = $context->with(ContextKeys::propagator(), $this->propagator);
    }
    if ($this->loggerProvider !== null) {
        $context = $context->with(ContextKeys::loggerProvider(), $this->loggerProvider);
    }
    if ($this->eventLoggerProvider !== null) {
        $context = $context->with(ContextKeys::eventLoggerProvider(), $this->eventLoggerProvider);
    }
    return $context;
}

API Navigation

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