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

Breadcrumb

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

function BaggagePropagator::extract

Overrides TextMapPropagatorInterface::extract

File

vendor/open-telemetry/api/Baggage/Propagation/BaggagePropagator.php, line 73

Class

BaggagePropagator

Namespace

OpenTelemetry\API\Baggage\Propagation

Code

public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null) : ContextInterface {
    $getter ??= ArrayAccessGetterSetter::getInstance();
    $context ??= Context::getCurrent();
    if (!($baggageHeader = $getter->get($carrier, self::BAGGAGE))) {
        return $context;
    }
    $baggageBuilder = Baggage::getBuilder();
    $this->extractValue($baggageHeader, $baggageBuilder);
    return $context->withContextValue($baggageBuilder->build());
}

API Navigation

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