Skip to content

Commit

Permalink
Metrics Adapter: remove deprecated Prom Metrics and cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
zroubalik committed Apr 26, 2023
1 parent 9d22b0c commit 8bde4c8
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 787 deletions.
8 changes: 0 additions & 8 deletions cmd/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
kedacontrollers "github.com/kedacore/keda/v2/controllers/keda"
"github.com/kedacore/keda/v2/pkg/metricsservice"
prommetrics "github.com/kedacore/keda/v2/pkg/prommetrics/adapter"
kedaprovider "github.com/kedacore/keda/v2/pkg/provider"
"github.com/kedacore/keda/v2/pkg/scaling"
kedautil "github.com/kedacore/keda/v2/pkg/util"
Expand All @@ -60,8 +59,6 @@ type Adapter struct {
var logger = klogr.New().WithName("keda_metrics_adapter")

var (
prometheusMetricsPort int
prometheusMetricsPath string
adapterClientRequestQPS float32
adapterClientRequestBurst int
metricsAPIServerPort int
Expand Down Expand Up @@ -153,9 +150,6 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat
externalMetricsInfo := &[]provider.ExternalMetricInfo{}
externalMetricsInfoLock := &sync.RWMutex{}

prometheusServer := &prommetrics.PrometheusMetricServer{}
go func() { prometheusServer.NewServer(fmt.Sprintf(":%v", prometheusMetricsPort), prometheusMetricsPath) }()

stopCh := make(chan struct{})
if err := runScaledObjectController(ctx, mgr, handler, logger, externalMetricsInfo, externalMetricsInfoLock, maxConcurrentReconciles, stopCh, secretInformer.Informer().HasSynced); err != nil {
return nil, nil, err
Expand Down Expand Up @@ -246,8 +240,6 @@ func main() {
cmd.Flags().StringVar(&cmd.Message, "msg", "starting adapter...", "startup message")
cmd.Flags().AddGoFlagSet(flag.CommandLine) // make sure we get the klog flags
cmd.Flags().IntVar(&metricsAPIServerPort, "port", 8080, "Set the port for the metrics API server")
cmd.Flags().IntVar(&prometheusMetricsPort, "metrics-port", 9022, "Set the port to expose prometheus metrics")
cmd.Flags().StringVar(&prometheusMetricsPath, "metrics-path", "/metrics", "Set the path for the prometheus metrics endpoint")
cmd.Flags().StringVar(&metricsServiceAddr, "metrics-service-address", generateDefaultMetricsServiceAddr(), "The address of the gRPRC Metrics Service Server.")
cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
Expand Down
2 changes: 0 additions & 2 deletions config/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ spec:
name: https
- containerPort: 8080
name: http
- containerPort: 9022
name: metrics
volumeMounts:
- mountPath: /tmp
name: temp-vol
Expand Down
3 changes: 0 additions & 3 deletions config/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ spec:
- name: http
port: 80
targetPort: 8080
- name: metrics
port: 9022
targetPort: 9022
selector:
app: keda-metrics-apiserver
2 changes: 0 additions & 2 deletions config/prometheus/kustomization.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/prometheus/monitor.yaml

This file was deleted.

Loading

0 comments on commit 8bde4c8

Please sign in to comment.