getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.97k stars 1.57k forks source link

node: Optional request body compression #2613

Closed rhcarvalho closed 1 year ago

rhcarvalho commented 4 years ago

Summary

Add option to enable compression of event payloads before sending them with @sentry/node.

Motivation

Sometimes it might be beneficial to compress request bodies before sending to Sentry. This would trade some CPU and extra dependencies for less bytes over the network.

Additional Context

This was an ask/observation from @thinkocapo.


The old raven-node SDK unconditionally compressed outgoing request bodies using the zlib package from Node.js' standard library:

https://github.com/getsentry/sentry-javascript/blob/7b664ff3a828fe59e32ccc182d5b4bb449dc9402/packages/raven-node/lib/client.js#L335


If this is ever implemented, the performance considerations discussed in the Node.js documentation and the care to limit concurrency as in raven-node should be taken into account:

jarektomanek commented 1 year ago

Is this feature planned for implementation for sentry-javascript?

Transaction payload can easily grow to sizes of 100 KB or more when multiple extra spans are added (f.e. @Sentry.TraceMethodDecorator() added to ngOnChanges). This is suboptimal for UX. Having requests' compression would be appreciated.

smeubank commented 1 year ago

closing for now until we receive more demand for this feature