feat(grpc): add client keepalive config (#112158)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
||||
@@ -52,6 +53,7 @@ type StorageOptions struct {
|
||||
GrpcClientAuthenticationTokenExchangeURL string
|
||||
GrpcClientAuthenticationTokenNamespace string
|
||||
GrpcClientAuthenticationAllowInsecure bool
|
||||
GrpcClientKeepaliveTime time.Duration
|
||||
|
||||
// Secrets Manager Configuration for InlineSecureValueSupport
|
||||
SecretsManagerGrpcClientEnable bool
|
||||
@@ -90,6 +92,7 @@ func NewStorageOptions() *StorageOptions {
|
||||
Address: "localhost:10000",
|
||||
GrpcClientAuthenticationTokenNamespace: "*",
|
||||
GrpcClientAuthenticationAllowInsecure: false,
|
||||
GrpcClientKeepaliveTime: 0,
|
||||
BlobThresholdBytes: BlobThresholdDefault,
|
||||
}
|
||||
}
|
||||
@@ -103,6 +106,7 @@ func (o *StorageOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&o.GrpcClientAuthenticationTokenExchangeURL, "grpc-client-authentication-token-exchange-url", o.GrpcClientAuthenticationTokenExchangeURL, "Token exchange url for grpc client authentication")
|
||||
fs.StringVar(&o.GrpcClientAuthenticationTokenNamespace, "grpc-client-authentication-token-namespace", o.GrpcClientAuthenticationTokenNamespace, "Token namespace for grpc client authentication")
|
||||
fs.BoolVar(&o.GrpcClientAuthenticationAllowInsecure, "grpc-client-authentication-allow-insecure", o.GrpcClientAuthenticationAllowInsecure, "Allow insecure grpc client authentication")
|
||||
fs.DurationVar(&o.GrpcClientKeepaliveTime, "grpc-client-keepalive-time", o.GrpcClientKeepaliveTime, "gRPC client keep-alive ping interval (e.g., 6m).")
|
||||
|
||||
// Secrets Manager Configuration flags
|
||||
fs.BoolVar(&o.SecretsManagerGrpcClientEnable, "grafana.secrets-manager.grpc-client-enable", false, "Enable gRPC client for secrets manager")
|
||||
|
||||
Reference in New Issue
Block a user