Skip to content

feat: add gzip compression strategy#759

Merged
williazz merged 5 commits intomainfrom
dev/gzip
Feb 9, 2026
Merged

feat: add gzip compression strategy#759
williazz merged 5 commits intomainfrom
dev/gzip

Conversation

@williazz
Copy link
Collaborator

@williazz williazz commented Feb 5, 2026

Summary

This is an opt-in feature to support compression via the CompressionStream API. Currently, we are hard coded to use GZIP algorithm, 2KB minimum raw size to compress, and 80% minimum compression ratio to dispatch. In the future, we may expose these configurations. For now, end user just needs to add this to config to enable:

const config: AwsRumConfig = {
        compressionStrategy: {
            enabled: true
        },
        ...
    };

Also, I updated InternalLogger to use a boolean to check if debug mode is enabled, so that we don't have to do all these annoying config.debug lookups.

Testing

Updated unit, integ. Smoke tests are missing right now, and honestly it is pretty annoying to write refactor them based on how they are currently setup, and I couldn't get them working. I will follow up with a separate PR for smoke tests

Manual testing

GZIP compression shown in network tab payload

Screenshot 2026-02-04 at 1 50 02 PM

GZIP compression ingestion in RUM console

Screenshot 2026-02-04 at 1 49 37 PM

GZIP compression ingestion in logs

Screenshot 2026-02-04 at 1 54 15 PM

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@williazz williazz requested review from ishajos and ps863 February 5, 2026 17:41
@williazz williazz marked this pull request as ready for review February 5, 2026 17:41
@ishajos
Copy link
Contributor

ishajos commented Feb 6, 2026

Can you update the description to include the changes related to modifying InternalLogger with a debugEnabled option?

@ps863
Copy link
Member

ps863 commented Feb 9, 2026

comment: We need some monitoring around if/if not the payload compression is not corrupted and the entire payload is received as was sent from the client.

I think the smoke tests can achieve this as long as we check the entire payload carefully. Otherwise we run a risk of having a silent bug which will never be caught

@ps863
Copy link
Member

ps863 commented Feb 9, 2026

comment: We should point out somewhere in docs for users using proxies and modifying the payload, they would need to update their proxy level configs to handle compressed requests (if they choose to opt in)

@williazz
Copy link
Collaborator Author

williazz commented Feb 9, 2026

okay will

  1. improve monitoring
  2. update docs // this may not impact proxies if they are just forwarding the payloads

@williazz williazz merged commit 03429f2 into main Feb 9, 2026
10 of 11 checks passed
@williazz williazz mentioned this pull request Feb 9, 2026
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.

3 participants