mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
feat: adds compression and bigger receive limit to agent grpc (#4162)
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/credentials"
|
"google.golang.org/grpc/credentials"
|
||||||
|
"google.golang.org/grpc/encoding/gzip"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
"google.golang.org/protobuf/types/known/timestamppb"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
)
|
)
|
||||||
@@ -45,7 +46,10 @@ func NewClient(endpoint string, certificates tls.Certificate, opts ...grpc.DialO
|
|||||||
// Create the gRPC transport credentials
|
// Create the gRPC transport credentials
|
||||||
creds := credentials.NewTLS(tlsConfig)
|
creds := credentials.NewTLS(tlsConfig)
|
||||||
|
|
||||||
opts = append(opts, grpc.WithTransportCredentials(creds))
|
opts = append(opts,
|
||||||
|
grpc.WithTransportCredentials(creds),
|
||||||
|
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10*1024*1024), grpc.UseCompressor(gzip.Name)),
|
||||||
|
)
|
||||||
conn, err := grpc.NewClient(endpoint, opts...)
|
conn, err := grpc.NewClient(endpoint, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to connect to %s: %w", endpoint, err)
|
return nil, fmt.Errorf("failed to connect to %s: %w", endpoint, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user