Skip to content
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

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

slon
Copy link
Contributor

@slon slon commented Aug 28, 2021

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.

@slon slon requested a review from a team as a code owner August 28, 2021 13:50
@slon slon requested a review from vprithvi August 28, 2021 13:50
yurishkuro
yurishkuro previously approved these changes Aug 28, 2021
@yurishkuro yurishkuro enabled auto-merge (squash) August 28, 2021 18:35
auto-merge was automatically disabled August 28, 2021 21:17

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"
Copy link
Member

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

Copy link
Contributor Author

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
Copy link

codecov bot commented Aug 29, 2021

Codecov Report

Merging #3236 (1c65291) into master (8427e01) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 1c65291 differs from pull request most recent head 0375e50. Consider uploading reports for the commit 0375e50 to get more accurate results
Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
cmd/collector/app/handler/grpc_handler.go 85.71% <ø> (ø)
pkg/config/tlscfg/cert_watcher.go 92.63% <0.00%> (-2.11%) ⬇️
cmd/flags/flags.go 46.29% <0.00%> (-1.92%) ⬇️
cmd/flags/admin.go 82.81% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8427e01...0375e50. Read the comment docs.

@@ -19,6 +19,7 @@ import (

"go.uber.org/zap"
"google.golang.org/grpc/codes"
_ "google.golang.org/grpc/encoding/gzip" // enable gzip compression support
Copy link
Contributor

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?

Copy link
Contributor Author

@slon slon Aug 29, 2021

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>
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.

Enable gzip compression in collector GRPC endpoint
4 participants