Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics Adapter: remove deprecated Prom Metrics and non-gRPC code #4479

Merged
merged 1 commit into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio

### Improvements

- **General**: Metrics Adapter: remove deprecated Prometheus Metrics and non-gRPC code ([#3930](https://github.com/kedacore/keda/issues/3930))
- **Azure Data Exporer Scaler**: Use azidentity SDK ([#4489](https://github.com/kedacore/keda/issues/4489))
- **GCP PubSub Scaler**: Make it more flexible for metrics ([#4243](https://github.com/kedacore/keda/issues/4243))

Expand Down
8 changes: 0 additions & 8 deletions cmd/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (

kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
"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 @@ -55,8 +54,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 @@ -145,9 +142,6 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat
handler := scaling.NewScaleHandler(mgr.GetClient(), nil, scheme, globalHTTPTimeout, recorder, secretInformer.Lister())
kubeInformerFactory.Start(ctx.Done())

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

logger.Info("Connecting Metrics Service gRPC client to the server", "address", metricsServiceAddr)
grpcClient, err := metricsservice.NewGrpcClient(metricsServiceAddr, a.SecureServing.ServerCert.CertDirectory)
if err != nil {
Expand Down Expand Up @@ -209,8 +203,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