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

Breadcrumb

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

function TraceContextPropagator::extract

Overrides TextMapPropagatorInterface::extract

File

vendor/open-telemetry/api/Trace/Propagation/TraceContextPropagator.php, line 84

Class

TraceContextPropagator
TraceContext is a propagator that supports the W3C Trace Context format (https://www.w3.org/TR/trace-context/)

Namespace

OpenTelemetry\API\Trace\Propagation

Code

public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null) : ContextInterface {
    $getter ??= ArrayAccessGetterSetter::getInstance();
    $context ??= Context::getCurrent();
    $spanContext = self::extractImpl($carrier, $getter);
    if (!$spanContext->isValid()) {
        return $context;
    }
    return $context->withContextValue(Span::wrap($spanContext));
}

API Navigation

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