Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan committed Oct 14, 2023
1 parent c4c632e commit 1bb0ca0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
9 changes: 4 additions & 5 deletions flyteadmin/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ type ServerConfig struct {
DataProxy DataProxyConfig `json:"dataProxy" pflag:",Defines data proxy configuration."`
ReadHeaderTimeoutSeconds int `json:"readHeaderTimeoutSeconds" pflag:",The amount of time allowed to read request headers."`
KubeClientConfig KubeClientConfig `json:"kubeClientConfig" pflag:",Configuration to control the Kubernetes client"`

EnableGrpcHistograms bool `json:"enableGrpcHistograms" pflag:",Enable grpc histograms"`
}

type DataProxyConfig struct {
Expand All @@ -49,9 +47,10 @@ type DataProxyUploadConfig struct {
}

type GrpcConfig struct {
Port int `json:"port" pflag:",On which grpc port to serve admin"`
ServerReflection bool `json:"serverReflection" pflag:",Enable GRPC Server Reflection"`
MaxMessageSizeBytes int `json:"maxMessageSizeBytes" pflag:",The max size in bytes for incoming gRPC messages"`
Port int `json:"port" pflag:",On which grpc port to serve admin"`
ServerReflection bool `json:"serverReflection" pflag:",Enable GRPC Server Reflection"`
MaxMessageSizeBytes int `json:"maxMessageSizeBytes" pflag:",The max size in bytes for incoming gRPC messages"`
EnableGrpcHistograms bool `json:"enableGrpcHistograms" pflag:",Enable grpc histograms"`
}

// KubeClientConfig contains the configuration used by flyteadmin to configure its internal Kubernetes Client.
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/pkg/config/serverconfig_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions flyteadmin/pkg/config/serverconfig_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flyteadmin/pkg/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func newGRPCServer(ctx context.Context, pluginRegistry *plugins.Registry, cfg *c
pluginRegistry.RegisterDefault(plugins.PluginIDUnaryServiceMiddleware, grpcmiddleware.ChainUnaryServer(
RequestIDInterceptor, auth.BlanketAuthorization, auth.ExecutionUserIdentifierInterceptor))

if cfg.EnableGrpcHistograms {
if cfg.GrpcConfig.EnableGrpcHistograms {
grpcprometheus.EnableHandlingTimeHistogram()
}

Expand Down

0 comments on commit 1bb0ca0

Please sign in to comment.