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 gRPC reflection service on collector/query #3526

Merged
merged 10 commits into from
Feb 13, 2022

Conversation

yurishkuro
Copy link
Member

Resolves #3417

Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro requested a review from a team as a code owner February 13, 2022 03:32
@yurishkuro yurishkuro requested review from vprithvi and albertteoh and removed request for vprithvi February 13, 2022 03:32
server := grpc.NewServer()
defer server.Stop()

listener, err := net.Listen("tcp", ":0")
Copy link
Member Author

@yurishkuro yurishkuro Feb 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed manual setup, using official StartGRPCServer

Signed-off-by: Yuri Shkuro <github@ysh.us>
@codecov
Copy link

codecov bot commented Feb 13, 2022

Codecov Report

Merging #3526 (1fef34a) into main (0b700b8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 1fef34a differs from pull request most recent head 398c2a7. Consider uploading reports for the commit 398c2a7 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3526      +/-   ##
==========================================
- Coverage   96.47%   96.47%   -0.01%     
==========================================
  Files         262      263       +1     
  Lines       15338    15376      +38     
==========================================
+ Hits        14798    14834      +36     
- Misses        456      458       +2     
  Partials       84       84              
Impacted Files Coverage Δ
cmd/collector/app/server/grpc.go 86.66% <100.00%> (+0.30%) ⬆️
cmd/query/app/server.go 94.25% <100.00%> (-1.33%) ⬇️
internal/grpctest/reflection.go 100.00% <100.00%> (ø)
pkg/config/tlscfg/cert_watcher.go 92.63% <0.00%> (-2.11%) ⬇️
cmd/query/app/static_handler.go 95.80% <0.00%> (+1.79%) ⬆️

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 0b700b8...398c2a7. Read the comment docs.

}

// StartGRPCServer based on the given parameters
func StartGRPCServer(params *GRPCServerParams) (*grpc.Server, error) {
var server *grpc.Server
var grpcOpts []grpc.ServerOption

grpcOpts = append(grpcOpts, grpc.MaxRecvMsgSize(params.MaxReceiveMessageLength))
if params.MaxReceiveMessageLength > 0 {
grpcOpts = append(grpcOpts, grpc.MaxRecvMsgSize(params.MaxReceiveMessageLength))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a 0 value as option actually breaks gRPC message handling/ I guess it wasn't a problem in prod code since the default comes from a CLI flag, but in tests it was annoying having to keep setting this param.

Handler: handler.NewGRPCHandler(logger, &mockSpanProcessor{}),
SamplingStore: &mockSamplingStore{},
Logger: logger,
MaxReceiveMessageLength: 1024 * 1024,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made this the only place where param is initialized in tests, to have code coverage for the if statement

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro
Copy link
Member Author

@albertteoh please review

albertteoh
albertteoh previously approved these changes Feb 13, 2022
internal/grpctest/reflection.go Outdated Show resolved Hide resolved
cmd/collector/app/server/grpc_test.go Outdated Show resolved Hide resolved
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro enabled auto-merge (squash) February 13, 2022 17:37
@yurishkuro yurishkuro merged commit b3534f3 into jaegertracing:main Feb 13, 2022
@yurishkuro yurishkuro deleted the grpc-reflection branch February 13, 2022 17:38
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.

Idea: support gRPC reflection
2 participants