private function prepareTransaction()
    {
        $this->transaction->setSpanCount([
            'started' => count($this->spans)
        ]);

        if (empty($this->transaction->getContext()) || empty($this->spans)) {
            $this->transaction->setSampled(false);
        }
    }