src/Agent.php
private function prepareSpan(Span $span): Span
    {
        $span->setTransactionId($this->transaction->getId());
        $span->setTraceId($this->transaction->getTraceId());

        if ($span->getId() === null) {
            $span->setId(AbstractEventBuilder::generateRandomBitsInHex(64));
        }

        if ($span->getParentId() === null) {
            $span->setParentId($this->transaction->getId());
        }

        if ($span->getStart() === null) {
            $span->setStart(
                intval(round(($span->getTimestamp() - $this->transaction->getTimestamp()) / 1000))
            );
        }

        return $span;
    }
private function prepareSpan(Span $span): Span
    {
        $span->setTransactionId($this->transaction->getId());
        $span->setTraceId($this->transaction->getTraceId());

        if ($span->getId() === null) {
            $span->setId(AbstractEventBuilder::generateRandomBitsInHex(64));
        }

        if ($span->getParentId() === null) {
            $span->setParentId($this->transaction->getId());
        }

        if ($span->getStart() === null) {
            $span->setStart(
                intval(round(($span->getTimestamp() - $this->transaction->getTimestamp()) / 1000))
            );
        }

        return $span;
    }
private function prepareSpan ( Span $ span ) : Span { $ span -> setTransactionId ( $ this -> transaction -> getId ( ) ) ; $ span -> setTraceId ( $ this -> transaction -> getTraceId ( ) ) ; if ( $ span -> getId ( ) === null ) { $ span -> setId ( AbstractEventBuilder :: generateRandomBitsInHex ( 64 ) ) ; } if ( $ span -> getParentId ( ) === null ) { $ span -> setParentId ( $ this -> transaction -> getId ( ) ) ; } if ( $ span -> getStart ( ) === null ) { $ span -> setStart ( intval ( round ( ( $ span -> getTimestamp ( ) - $ this -> transaction -> getTimestamp ( ) ) / 1000 ) ) ) ; } return $ span ; }
Prepare span for for sending to APM.
@param Span $span
@return Span
@throws \Exception
Prepare span for for sending to APM .