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\PropagationCode
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));
}