Skip to content

feat!: Enable event payload compression by default - #556

Open
keelerm84 wants to merge 1 commit into
feat/10.xfrom
mk/SDK-3388/event-compression-default
Open

keelerm84 wants to merge 1 commit into
feat/10.xfrom
mk/SDK-3388/event-compression-default

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

enable_event_compression now defaults to True in both Config and AsyncConfig, so the SDK gzip-compresses event payloads unless you opt out.

Relay Proxy versions before 8.9 cannot accept compressed events. If you send events through one, set enable_event_compression=False. Relay Proxy users on newer versions may also want to disable it to avoid the decompress/recompress overhead. The parameter docstrings say this.

  • The event processors already read the flag, so they need no change.
  • The test mocks (HTTP clients and mock server) now decompress gzip bodies, so existing tests run on the compressed default. New tests cover the default and the opt-out for both configs and both event processors.

This matches the Rust server SDK, which made the same change in v3.


Note

Overview
Breaking change: enable_event_compression now defaults to True on both Config and AsyncConfig, so new clients gzip-compress analytics event bulk POSTs unless explicitly disabled. Event processors already honor the flag; this PR only flips the default and expands the parameter docs (Relay Proxy < 8.9 must set enable_event_compression=False; newer Relay Proxy users may disable to skip decompress/recompress CPU).

Test helpers were updated so the suite keeps working with compressed bodies by default: decode_request_body, auto-decompression on MockHttp.request_data / MockAioHttp.request_data, a new raw_request_data for assertions on the wire bytes, and gzip handling in the integration MockServerRequest. Added config default/opt-out tests and sync/async processor tests for compressed-by-default and uncompressed-when-disabled behavior.

Reviewed by Cursor Bugbot for commit b0501f0. Bugbot is set up for automated code reviews on this repo. Configure here.

The SDK now gzip-compresses analytics event payloads unless
enable_event_compression is set to False, on both Config and AsyncConfig.
Compression reduces the bandwidth that event delivery uses.

Relay Proxy versions before 8.9 cannot accept compressed events. If you
send events through such a Relay Proxy, set enable_event_compression=False.
@keelerm84
keelerm84 requested a review from a team as a code owner November 2, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant