Skip to content

Commit

Permalink
Add flyteadmin server config option to enable grpc histogram metrics (f…
Browse files Browse the repository at this point in the history
…lyteorg#4231)

Signed-off-by: squiishyy <[email protected]>
  • Loading branch information
katrogan authored and squiishyy committed Oct 18, 2023
1 parent 2f3fe6c commit 4928a44
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
7 changes: 4 additions & 3 deletions flyteadmin/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,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
1 change: 1 addition & 0 deletions flyteadmin/pkg/config/serverconfig_flags.go

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

14 changes: 14 additions & 0 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.

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

if cfg.GrpcConfig.EnableGrpcHistograms {
logger.Debugf(ctx, "enabling grpc histogram metrics")
grpcprometheus.EnableHandlingTimeHistogram()
}

// Not yet implemented for streaming
var chainedUnaryInterceptors grpc.UnaryServerInterceptor
if cfg.Security.UseAuth {
Expand Down

0 comments on commit 4928a44

Please sign in to comment.