From 31cba70951af290b8565f98fdacc3289afd0bcd5 Mon Sep 17 00:00:00 2001 From: "Walther E. Lee" Date: Wed, 18 Oct 2023 13:59:25 -0700 Subject: [PATCH] add keepalive to EndpointGroupGRPCOpts (#6810) Signed-off-by: Walther Lee --- pkg/extgrpc/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/extgrpc/client.go b/pkg/extgrpc/client.go index 564261268d..89790d1e19 100644 --- a/pkg/extgrpc/client.go +++ b/pkg/extgrpc/client.go @@ -5,6 +5,7 @@ package extgrpc import ( "math" + "time" "github.com/go-kit/log" "github.com/go-kit/log/level" @@ -15,6 +16,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/keepalive" "github.com/thanos-io/thanos/pkg/tls" "github.com/thanos-io/thanos/pkg/tracing" @@ -38,6 +40,7 @@ func EndpointGroupGRPCOpts() []grpc.DialOption { return []grpc.DialOption{ grpc.WithDefaultServiceConfig(serviceConfig), + grpc.WithKeepaliveParams(keepalive.ClientParameters{Time: 10 * time.Second, Timeout: 5 * time.Second}), } }