getsentry / getsentry/sentry-go

Refactor Envelope build & sending

Open
#643 0 comments 0 reactions 0 assignees View on GitHub
Feature Go
Dominant language
Go
Stars
1.1k
Forks
262
Avg merge
1d 48m
Merged PRs (30d)
7

Description

## 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](https://github.com/getsentry/sentry-go/pull/626/files/8417a7bdf3462217a959ea9e1f4e2e0876dc235f#diff-5982a4ca350449c8a5deba675bc4bc4bb0f1823c45e6c7ba0076cc6b159fef8fR156) - 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.