Conversation
3e5579e to
3f9d1ae
Compare
jan-auer
requested changes
Mar 5, 2021
| class HTTPTransport < Transport | ||
| CONTENT_TYPE = 'application/json' | ||
| GZIP_ENCODING = "gzip" | ||
| GZIP_THRESHOLD = 1024 * 30 |
Member
There was a problem hiding this comment.
What is the "usual" size and throughput of Ruby events that you've seen so far? A threshold of somewhere around 32kB seems reasonable intuitively, I'd just love to confirm.
Contributor
Author
There was a problem hiding this comment.
In Rails apps, I think it's generally over 40kb because of the framework's stacktrace. But it could be quite small on non-Ruby apps, like 1x kb.
3f9d1ae to
9ad9732
Compare
Rules: - If `config.transport.encoding == "gzip"` and the event envelope's size is larger than 30kb, the envelope will be compressed. - If `config.transport.encoding == "gzip"` but the event envelope's size is smaller than 30kb, the envelope won't be compressed. - If `config.transport.encoding != "gzip"`, the event won't be compressed regardless how but it is.
9ad9732 to
998b591
Compare
jan-auer
approved these changes
Mar 5, 2021
Member
jan-auer
left a comment
There was a problem hiding this comment.
Looks good, thanks! Deferring final review to @HazAT.
The implementation sets Content-Encoding: <empty> if should_compress? returns false. I believe that this will work, but please make sure to test this against Sentry SaaS once.
Contributor
Author
|
@jan-auer thanks for the review. I've tested it and it works as expected 🙂 |
HazAT
approved these changes
Mar 5, 2021
This was referenced Mar 12, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rules:
config.transport.encoding == "gzip"and the event envelope's size is larger than 30kb, the envelope will be compressed.config.transport.encoding == "gzip"but the event envelope's size is smaller than 30kb, the envelope won't be compressed.config.transport.encoding != "gzip", the event won't be compressed regardless how but it is.