-
Notifications
You must be signed in to change notification settings - Fork 4.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
xds: Process telemetry labels from CDS in xDS Balancers #7116
Conversation
f0b77b1
to
6f853db
Compare
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; just a few nits
internal/stats/labels.go
Outdated
|
||
type labelsKey struct{} | ||
|
||
// GetLabels returns the Labels stored in theo context, or nil if there is one |
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.
theo* and end sentence with punctuation pls.
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.
Done for both.
internal/stats/labels.go
Outdated
return labels | ||
} | ||
|
||
// SetLabels sets the Labels |
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.
Please finish the sentence.
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.
Added in the context.
testgrpc "google.golang.org/grpc/interop/grpc_testing" | ||
testpb "google.golang.org/grpc/interop/grpc_testing" |
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.
Please group pbs.
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.
Argh, this slipped through. Switched.
} | ||
|
||
func newPicker(s balancer.State, config *dropConfigs, loadStore load.PerClusterReporter) *picker { | ||
func newPicker(s balancer.State, config *dropConfigs, loadStore load.PerClusterReporter, telemetryLabels map[string]string) *picker { |
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.
Shall we make this a method on the balancer instead of adding more parameters?
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.
Good point, done.
for key, value := range d.telemetryLabels { | ||
labels.TelemetryLabels[key] = value | ||
} | ||
} // Unconditionally set, even dropped or queued RPC's can use this label. |
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.
Move to above if info.Ctx != nil
or just inside the open brace?
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.
Added above the info.Ctx != nil check, the comment turned out to be: Unconditionally set labels if present, even dropped or queued RPC's can use these labels.
// handler asserts that subsequent HandleRPC calls from the RPC lifecycle | ||
// contain telemetry labels that it can see. | ||
func (s) TestTelemetryLabels(t *testing.T) { | ||
managementServer, nodeID, _, resolver, cleanup1 := e2e.SetupManagementServer(t, e2e.ManagementServerOptions{}) |
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.
s/cleanup1/cleanup/ please
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.
Ah, switched.
// aren't started. All of these should have access to the desired telemetry | ||
// labels. |
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 you mean to test all 3, you will need a continue
on the cases. Or case a, b, c:
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.
Whoops switched.
This PR plumbs the Telemetry Labels from CDS through our xDS Balancer tree through the context that eventually get passed to stats handler.
RELEASE NOTES: N/A