-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributor: Loki API can receive gzipped JSON #3291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3291 +/- ##
==========================================
- Coverage 62.64% 62.62% -0.03%
==========================================
Files 201 201
Lines 17110 17123 +13
==========================================
+ Hits 10719 10723 +4
- Misses 5431 5442 +11
+ Partials 960 958 -2
|
@@ -97,6 +117,7 @@ func ParseRequest(r *http.Request) (*logproto.PushRequest, error) { | |||
"msg", "push request parsed", | |||
"path", r.URL.Path, | |||
"contentType", contentType, | |||
"contentEncoding", contentEncoding, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
I notice we don't have an http_test.go
file, so I won't ask that you include some additional testing for this unless you'd like to.
Follow ups for @cyriltovena & myself:
- use gzip pools
- test gzip endcoded proto & json bodies
Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Push API recognize HTTP header "Content-Encoding: gzip" and upload gzipped JSON * Fix documentation mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did broke something.
What this PR does / why we need it:
This PR allow send gzipped
JSON
to push endpoint.HTTP server recognize
Content-Encoding: gzip
request header (for JSON only) and unpack request body.This option can reduce network traffic (5-30 times) and can be useful for sending logs to remote server.
Which issue(s) this PR fixes:
Fixes #3205
Special notes for your reviewer:
Checklist