From 33e0a40b95bbf596ee0fdc537b654dd5d7320c59 Mon Sep 17 00:00:00 2001 From: Deepak Kinni Date: Tue, 14 Jan 2025 08:35:04 -0800 Subject: [PATCH] Remove prometheus support (#599) Signed-off-by: Deepak Kinni --- pkg/cmd/backupdriver/cli/server/server.go | 3 --- pkg/cmd/constants.go | 3 --- pkg/cmd/datamgr/cli/server/server.go | 4 ---- 3 files changed, 10 deletions(-) diff --git a/pkg/cmd/backupdriver/cli/server/server.go b/pkg/cmd/backupdriver/cli/server/server.go index a28b3c05..6fec2293 100644 --- a/pkg/cmd/backupdriver/cli/server/server.go +++ b/pkg/cmd/backupdriver/cli/server/server.go @@ -73,7 +73,6 @@ func NewCommand(f client.Factory) *cobra.Command { var ( logLevelFlag = logging.LogLevelFlag(logrus.InfoLevel) config = serverConfig{ - metricsAddress: cmd.DefaultMetricsAddress, clientQPS: cmd.DefaultClientQPS, clientBurst: cmd.DefaultClientBurst, profilerAddress: cmd.DefaultProfilerAddress, @@ -127,7 +126,6 @@ func NewCommand(f client.Factory) *cobra.Command { // Common flags command.Flags().Var(logLevelFlag, "log-level", fmt.Sprintf("the level at which to log. Valid values are %s.", strings.Join(logLevelFlag.AllowedValues(), ", "))) command.Flags().Var(config.formatFlag, "log-format", fmt.Sprintf("the format for log output. Valid values are %s.", strings.Join(config.formatFlag.AllowedValues(), ", "))) - command.Flags().StringVar(&config.metricsAddress, "metrics-address", config.metricsAddress, "the address to expose prometheus metrics") command.Flags().Float32Var(&config.clientQPS, "client-qps", config.clientQPS, "maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached") command.Flags().IntVar(&config.clientBurst, "client-burst", config.clientBurst, "maximum number of requests by the server to the Kubernetes API in a short period of time") command.Flags().StringVar(&config.profilerAddress, "profiler-address", config.profilerAddress, "the address to expose the pprof profiler") @@ -312,7 +310,6 @@ func newServer(f client.Factory, config serverConfig, logger *logrus.Logger) (*s s := &server{ namespace: f.Namespace(), - metricsAddress: config.metricsAddress, kubeClient: kubeClient, backupdriverClient: backupdriverClient, datamoverClient: datamoverClient, diff --git a/pkg/cmd/constants.go b/pkg/cmd/constants.go index 4939a3bf..436faefc 100644 --- a/pkg/cmd/constants.go +++ b/pkg/cmd/constants.go @@ -17,9 +17,6 @@ limitations under the License. package cmd const ( - // the port where prometheus metrics are exposed - DefaultMetricsAddress = ":8085" - // server's client default qps and burst DefaultClientQPS float32 = 100.0 DefaultClientBurst int = 100 diff --git a/pkg/cmd/datamgr/cli/server/server.go b/pkg/cmd/datamgr/cli/server/server.go index 6061a165..2d174401 100644 --- a/pkg/cmd/datamgr/cli/server/server.go +++ b/pkg/cmd/datamgr/cli/server/server.go @@ -54,7 +54,6 @@ import ( ) type serverConfig struct { - metricsAddress string clientQPS float32 clientBurst int profilerAddress string @@ -71,7 +70,6 @@ func NewCommand(f client.Factory) *cobra.Command { var ( logLevelFlag = logging.LogLevelFlag(logrus.InfoLevel) config = serverConfig{ - metricsAddress: cmd.DefaultMetricsAddress, clientQPS: cmd.DefaultClientQPS, clientBurst: cmd.DefaultClientBurst, profilerAddress: cmd.DefaultProfilerAddress, @@ -122,7 +120,6 @@ func NewCommand(f client.Factory) *cobra.Command { // Common flags command.Flags().Var(logLevelFlag, "log-level", fmt.Sprintf("the level at which to log. Valid values are %s.", strings.Join(logLevelFlag.AllowedValues(), ", "))) command.Flags().Var(config.formatFlag, "log-format", fmt.Sprintf("the format for log output. Valid values are %s.", strings.Join(config.formatFlag.AllowedValues(), ", "))) - command.Flags().StringVar(&config.metricsAddress, "metrics-address", config.metricsAddress, "the address to expose prometheus metrics") command.Flags().Float32Var(&config.clientQPS, "client-qps", config.clientQPS, "maximum number of requests per second by the server to the Kubernetes API once the burst limit has been reached") command.Flags().IntVar(&config.clientBurst, "client-burst", config.clientBurst, "maximum number of requests by the server to the Kubernetes API in a short period of time") command.Flags().StringVar(&config.profilerAddress, "profiler-address", config.profilerAddress, "the address to expose the pprof profiler") @@ -287,7 +284,6 @@ func newServer(f client.Factory, config serverConfig, logger *logrus.Logger) (*s s := &server{ namespace: f.Namespace(), - metricsAddress: config.metricsAddress, kubeClient: kubeClient, pluginClient: pluginClient, pluginInformerFactory: pluginInformers.NewSharedInformerFactoryWithOptions(pluginClient, constants.ResyncPeriod, pluginInformers.WithNamespace(f.Namespace())),