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

Optional request body compression

Open rhcarvalho opened this issue 5 years ago • 3 comments
trafficstars

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.

rhcarvalho avatar May 22 '20 14:05 rhcarvalho

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 avatar May 26 '20 04:05 thinkocapo

@thinkocapo, compression is optional.

  • For @sentry/browser the need for external dependencies makes compression not attractive;
  • For @sentry/node I'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.

rhcarvalho avatar May 26 '20 08:05 rhcarvalho

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.

rhcarvalho avatar May 26 '20 08:05 rhcarvalho

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 🥀

github-actions[bot] avatar Dec 07 '22 09:12 github-actions[bot]