fromOutgoingRequest() public method

public fromOutgoingRequest ( GuzzleHttp\Message\RequestInterface $request ) : Span
$request GuzzleHttp\Message\RequestInterface
return Tolerance\Tracer\Span\Span
示例#1
0
 /**
  * @param BeforeEvent $event
  */
 public function onBefore(BeforeEvent $event)
 {
     $request = $event->getRequest();
     $span = $this->guzzleMessageSpanFactory->fromOutgoingRequest($request);
     $this->tracer->trace([$span]);
     $request->addHeaders(['X-B3-SpanId' => (string) $span->getIdentifier(), 'X-B3-TraceId' => (string) $span->getTraceIdentifier(), 'X-B3-ParentSpanId' => (string) $span->getParentIdentifier(), 'X-B3-Flags' => $span->getDebug() ? '1' : '0']);
 }