DataDog / pg_tracing

Distributed Tracing for PostgreSQL
MIT License
34 stars 5 forks source link

Work on a copy of spans before sending to otel collector #41

Closed bonnefoa closed 2 months ago

bonnefoa commented 2 months ago

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.