To avoid locking spans with an exclusive lock while sending the json payload to the collector, we create a copy of both spans and spans_str and immediately release the lock.
From the copy, we marshal the json payload to be sent and attempt to send it. We keep this payload until send is successful.
To avoid locking spans with an exclusive lock while sending the json payload to the collector, we create a copy of both spans and spans_str and immediately release the lock.
From the copy, we marshal the json payload to be sent and attempt to send it. We keep this payload until send is successful.