-
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
Add gRPC communication between agent and collector #1165
Add gRPC communication between agent and collector #1165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1165 +/- ##
=======================================
Coverage 100% 100%
=======================================
Files 144 154 +10
Lines 6839 7034 +195
=======================================
+ Hits 6839 7034 +195
Continue to review full report at Codecov.
|
bool ok = 1; | ||
} | ||
|
||
service CollectorService { |
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.
For now I have excluded query service. Let's do it in a separate PR.
cmd/agent/app/reporter/grpc/flags.go
Outdated
|
||
const ( | ||
gRPCPrefix = "reporter.grpc." | ||
collectorHostPort = "collector.host-port" |
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.
Is this different from the old reporter? I thought that one supported a list of addresses.
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.
grpc dial supports only one address by default. An option is to use with balancer https://stackoverflow.com/a/50302295/4158442 not sure what that implies though.
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.
the load balancer implementation can be done later, I'm just asking whether the cmd line should support a list of addresses (it can fail for now on >1 address).
if err != nil { | ||
logger.Fatal("Unable to start listening on channel", zap.Error(err)) | ||
|
||
{ |
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 is a lot of duplication with the collector. It would be good to have all verbose initialization code in a shared package where it can be tested rather than in main.
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 will try to move it in some package in collector. The same applies for tchannel there is duplication even in the current master.
} | ||
|
||
// PostSpans implements gRPC CollectorService. | ||
func (g *GRPCHandler) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error) { |
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.
do we need new metrics here?
} | ||
|
||
service CollectorService { | ||
rpc PostSpans(PostSpansRequest) returns (PostSpansResponse) { |
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 feel like we should be using streaming in this API... Unless we expect the agent to resubmit to another collector on error (worth checking what OC agent is planning to do, those folks have a lot more experience with grpc).
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.
PS can be addressed in another PR, we should merge the infra first.
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.
If it can I would prefer.
Outstanding tasks:
I would prefer to do it in a separate PR if possible. |
That's fine with me (I'd prefer that too, this diff is already too large). But the main question we need to answer is what to do w.r.t. releasing 1.8. If there are any user-facing API changes (like supporting multiple addresses may change the cli flag name), then once we merge this PR we'll need to finish the outstanding tasks before cutting 1.8. Thoughts? |
Originally I wanted to cut 1.8 without gRPC to have more baking time in master before releasing it. I will have a look at the list of addresses. |
4375b29
to
1d31e81
Compare
@yurishkuro I have added load balancer support in the last commit. If you prefer I can revert it, supporting a list of collectors in the same flag is back compatible anyways. |
resolvedAddrs = append(resolvedAddrs, resolver.Address{Addr: addr}) | ||
} | ||
r.InitialAddrs(resolvedAddrs) | ||
conn, _ = grpc.Dial(r.Scheme()+":///jaeger.collector", grpc.WithInsecure(), grpc.WithBalancerName(roundrobin.Name)) |
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.
what is the significance of ":///jaeger.collector"
string?
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.
Actually I don't know, It seems that it can be any string after :///
https://github.com/grpc/grpc-go/blob/master/balancer/roundrobin/roundrobin_test.go#L136
I will merge after 1.8 is out |
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
0416497
to
b78e314
Compare
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Resolves some parts of #773
Rebased and modified #903 and #1042