Skip to content

Compress envelopes in server SDKs with zstd, falling back to gzip #20500

@logaretm

Description

@logaretm

@sentry/node / @sentry/node-core already gzip envelopes >32 KB (packages/node-core/src/transports/http.ts)

zstd is a better compression algorithm which is supported by Relay and is available on all major runtimes today, but support is relatively new:

Runtime Version Release date Evidence
Node.js v22.15.0 (LTS) / v23.8.0 ~Jan 2025 nodejs.org/api/zlib.html
Bun v1.2.14 ~May 2025 oven-sh/bun#23095, #20313
Deno v2.6.9 / v2.7.0 Feb 10 / Feb 25, 2026 denoland/deno#32025
Cloudflare Workers workerd merge Feb 19, 2026 ~Feb–Mar 2026 rollout (requires nodejs_compat flag) cloudflare/workerd#6117

The API offers better compression ratios which can be used on smaller than 32kb payloads we have today and offer better gains and less load to our users and our servers.

API is mainly available through node:zlib's createZstdCompress function. Worth noting that it is marked as experimental and on the time of writing this issue can be too new.

Seems its going to be used by our CLI getsentry/cli#843

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions