-
Notifications
You must be signed in to change notification settings - Fork 2.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
Enable gzip compression for collector grpc endpoint. #3236
Conversation
Head branch was pushed to by a user without write access
@@ -21,6 +21,9 @@ import ( | |||
"google.golang.org/grpc/codes" | |||
"google.golang.org/grpc/status" | |||
|
|||
// enable gzip compression support | |||
_ "google.golang.org/grpc/encoding/gzip" |
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 won't work, run make fmt
. The comment isn't necessary, ".../encoding/gzip" hints at that already
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 comment is required by golint.
cmd/collector/app/handler/grpc_handler.go:22:2: a blank import should be only in a main or test package, or have a comment justifying it
Codecov Report
@@ Coverage Diff @@
## master #3236 +/- ##
==========================================
- Coverage 95.99% 95.97% -0.02%
==========================================
Files 242 242
Lines 14815 14813 -2
==========================================
- Hits 14221 14217 -4
- Misses 514 516 +2
Partials 80 80
Continue to review full report at Codecov.
|
@@ -19,6 +19,7 @@ import ( | |||
|
|||
"go.uber.org/zap" | |||
"google.golang.org/grpc/codes" | |||
_ "google.golang.org/grpc/encoding/gzip" // enable gzip compression support |
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.
I think the linter error is from the old golint
implementation which has been deprecated in favour of go vet
and staticcheck
. I tested PR this with golangci-lint
and does not gripe about this line having a blank import.
If we want to avoid including this comment, we could try waiting for #3237 to be merged (if it's approved) and rebase?
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.
Thank you!
I'll wait for the #3237, and then update this PR.
Signed-off-by: Fedor Korotkiy <dartslon@gmail.com>
Which problem is this PR solving?
Resolves #3235
Short description of the changes
Import gzip compressor in cmd/collector/app/handler. That way gzip compressor is linked into every binary that exposes collector GRPC endpoint.