getTraceIdentifier() public method

public getTraceIdentifier ( ) : Identifier
return Identifier
 /**
  * @param Response $response
  * @param Span     $originalSpan
  *
  * @return Span
  */
 public function fromOutgoingResponse(Response $response, Span $originalSpan)
 {
     $timestamp = $this->clock->microseconds();
     return new Span($originalSpan->getIdentifier(), $originalSpan->getName(), $originalSpan->getTraceIdentifier(), [new Annotation(Annotation::SERVER_SEND, $timestamp, $this->endpointResolver->resolve())], [new BinaryAnnotation('http.status', $response->getStatusCode(), BinaryAnnotation::TYPE_INTEGER_16)], $originalSpan->getParentIdentifier(), $originalSpan->getDebug(), $originalSpan->getTimestamp(), $timestamp - $originalSpan->getTimestamp());
 }
Esempio n. 2
0
 /**
  * @param Span $span
  *
  * @return array
  */
 private function normalizeSpan(Span $span)
 {
     return ['id' => (string) $span->getIdentifier(), 'name' => $span->getName(), 'traceId' => (string) $span->getTraceIdentifier(), 'parentId' => null !== $span->getParentIdentifier() ? (string) $span->getParentIdentifier() : null, 'timestamp' => $span->getTimestamp(), 'duration' => $span->getDuration(), 'debug' => $span->getDebug(), 'annotations' => array_map([$this, 'normalizeAnnotation'], $span->getAnnotations()), 'binaryAnnotations' => array_map([$this, 'normalizeBinaryAnnotation'], $span->getBinaryAnnotations())];
 }
Esempio n. 3
0
 /**
  * @param ResponseInterface $response
  * @param Span              $originalSpan
  *
  * @return Span
  */
 public function fromIncomingResponse(Span $originalSpan, ResponseInterface $response = null)
 {
     return new Span($originalSpan->getIdentifier(), $originalSpan->getName(), $originalSpan->getTraceIdentifier(), [new Annotation(Annotation::CLIENT_RECEIVE, $this->clock->microseconds(), $this->endpointResolver->resolve())], [new BinaryAnnotation('http.status', $response !== null ? $response->getStatusCode() : 0, BinaryAnnotation::TYPE_INTEGER_16)], $originalSpan->getParentIdentifier(), $originalSpan->getDebug());
 }