22 if ( $spanContext === null ) {
25 $traceId = $spanContext->getTraceId();
26 $spanId = $spanContext->getSpanId();
27 $sampled = $spanContext->isSampled() ?
'01' :
'00';
28 if ( strlen( $traceId ) === 32 && strlen( $spanId ) === 16 ) {
29 $carrier[
'traceparent'] =
"00-{$traceId}-{$spanId}-{$sampled}";