sentry-go
sentry-go copied to clipboard
Optional request body compression
Summary
Add option to enable data compression on the transport(s).
Motivation
Sometimes it might be beneficial to compress request bodies before sending to Sentry. This would trade some CPU for less bytes over the network.
https://github.com/getsentry/sentry-go/blob/af3076c5259eb407873c99da142af3ee29051105/transport.go#L195-L199
Sentry/Relay accepts compressed payloads, see docs:
- https://develop.sentry.dev/sdk/overview/#request-compression
- https://develop.sentry.dev/sdk/store/#request-compression
Additional Context
This was an ask/observation from @thinkocapo back in April 27.
I found that sentry-javascript 15.13.2 (old) does not use gzip either, at least for how I'm using it in a React application. I checked https://develop.sentry.dev/sdk/store/#request-compression but it does not indicate it's required. I wonder how many sdk's are using it or not. @AbhiPrasad
Per your comment @rhcarvalho , you mean CPU by the app running Go and the sdk? I didn't think about that trade-off.
@thinkocapo, compression is optional.
- For
@sentry/browserthe need for external dependencies makes compression not attractive; - For
@sentry/nodeI've cut https://github.com/getsentry/sentry-javascript/issues/2613.
Per your comment @rhcarvalho , you mean CPU by the app running Go and the sdk? I didn't think about that trade-off.
Yes, correct.
An addition consideration / trade-off is additional dependencies.
Updated title/description moving away from gzip (specific algorithm) to general compression, also adding link to https://develop.sentry.dev/sdk/overview/#request-compression, which lists the supported compression formats.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀