-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Implement endpoint groups #5548
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,27 @@ import ( | |
"github.com/thanos-io/thanos/pkg/tracing" | ||
) | ||
|
||
// EndpointGroupGRPCOpts creates gRPC dial options for connecting to endpoint groups. | ||
// For details on retry capabilities, see https://github.com/grpc/proposal/blob/master/A6-client-retries.md#retry-policy-capabilities | ||
func EndpointGroupGRPCOpts() []grpc.DialOption { | ||
serviceConfig := ` | ||
{ | ||
"loadBalancingPolicy":"round_robin", | ||
"retryPolicy": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this should be configurable via flags? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this could be a good idea. The new endpoint config would also help here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add this flag in this PR, with this particular config as the default? 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This policy is really an implementation detail, I don't think it makes sense to expose it to the end user. The retry always has to be there so that the client will re-resolve dns endpoints when the one it's connected to goes away. This is how HA is implemented in gRPC. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see! |
||
"maxAttempts": 3, | ||
"initialBackoff": "0.1s", | ||
"backoffMultiplier": 2, | ||
"retryableStatusCodes": [ | ||
"UNAVAILABLE" | ||
] | ||
} | ||
}` | ||
|
||
return []grpc.DialOption{ | ||
grpc.WithDefaultServiceConfig(serviceConfig), | ||
} | ||
} | ||
|
||
// StoreClientGRPCOpts creates gRPC dial options for connecting to a store client. | ||
func StoreClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure, skipVerify bool, cert, key, caCert, serverName string) ([]grpc.DialOption, error) { | ||
grpcMets := grpc_prometheus.NewClientMetrics() | ||
|
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.
HA groups of Thanos components.
means store only?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.
It can be any component, querier, store, exemplar etc.. as long as they implement the same APIs. So a group should not have a mix of components.