public function insertBatch(array $traces, array $options = [])
    {
        $spans = [];
        foreach ($traces as $trace) {
            foreach ($trace->spans() as $span) {
                $spans[] = $this->transformSpan($span);
            }
        }
        // throws ServiceException on failure
        $this->connection->traceBatchWrite([
            'projectsId' => $this->projectId,
            'spans' => $spans
        ] + $options);
        return true;
    }