sentry-go icon indicating copy to clipboard operation
sentry-go copied to clipboard

Refactor Envelope build & sending

Open vaind opened this issue 2 years ago • 0 comments

Summary

Currently, events are handed over to transport for sending. In order to fully switch to Envelopes, transport should not know about events and instead accept envelopes for sending. Transport should also not do any event-type specific processing - all the information transport needs is contained in the Envelope & its Items. See https://develop.sentry.dev/sdk/envelopes/

Motivation

Besides finishing the move to Envelopes, the separation of concerns would allow us to build envelopes with multiple items, without hacking around events, as I've had to do in here - adding a transactionProfile field to Event and handling that in transport.go.

Additional Context

Ideally, I'd also suggest something to think about in the future - changing the APIs to not accept Event struct but rather an interface, sth. like which just knows how to serialize and deserialize itself. This would also make it more flexible and avoid adding fields specific to different event types, e.g. Transactions, as there already are.

vaind avatar May 27 '23 11:05 vaind