Skip to content

Commit

Permalink
feat: Add keepalive parameters to gRPC client configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Jun 29, 2024
1 parent c78dccc commit 5d8ffb6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/output/xatu/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net"
"time"

"github.com/ethpandaops/xatu/pkg/observability"
pb "github.com/ethpandaops/xatu/pkg/proto/xatu"
Expand All @@ -18,6 +19,7 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/encoding/gzip"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
)

Expand All @@ -33,7 +35,11 @@ func NewItemExporter(name string, config *Config, log logrus.FieldLogger) (ItemE
opts := []grpc.DialOption{
grpc.WithChainUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor, retry.UnaryClientInterceptor()),
grpc.WithChainStreamInterceptor(grpc_prometheus.StreamClientInterceptor, retry.StreamClientInterceptor()),
grpc.WithTimeout(config.ExportTimeout),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 10 * time.Second,
Timeout: 30 * time.Second,
PermitWithoutStream: true,
}),
}

if config.TLS {
Expand Down

0 comments on commit 5d8ffb6

Please sign in to comment.