-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
metricName
shouldn't be required and should be deprecated for Prometheus Scaler
#4230
Comments
Hey there, Here's my progress so far, as noted by the comments at: --- a/pkg/scalers/prometheus_scaler.go
+++ b/pkg/scalers/prometheus_scaler.go
@@ -82,7 +82,7 @@ func NewPrometheusScaler(config *ScalerConfig) (Scaler, error) {
logger := InitializeLogger(config, "prometheus_scaler")
- meta, err := parsePrometheusMetadata(config)
+ meta, err := parsePrometheusMetadata(config, logger)
if err != nil {
return nil, fmt.Errorf("error parsing prometheus metadata: %w", err)
}
@@ -110,7 +110,7 @@ func NewPrometheusScaler(config *ScalerConfig) (Scaler, error) {
}, nil
}
-func parsePrometheusMetadata(config *ScalerConfig) (meta *prometheusMetadata, err error) {
+func parsePrometheusMetadata(config *ScalerConfig, logger logr.Logger) (meta *prometheusMetadata, err error) {
meta = &prometheusMetadata{}
if val, ok := config.TriggerMetadata[promServerAddress]; ok && val != "" {
@@ -148,6 +148,7 @@ func parsePrometheusMetadata(config *ScalerConfig) (meta *prometheusMetadata, er
if val, ok := config.TriggerMetadata[promMetricName]; ok && val != "" {
meta.metricName = val
+ logger.Info("WARNING: the field 'metricName' has been deprecated and will be removed in v2.12")
}
if val, ok := config.TriggerMetadata[promNamespace]; ok && val != "" {``` |
Hi, |
I see. |
will be handled by #4220 |
Proposal
Currently, Prometheus Scaler requires a
metricName
which is used only for KEDA internal things (it's not sent to the prom server).This requirement isn't necessary since we introduced mechanisms to ensure the unique metrics names inside the ScaledObject and we should make it optional and also deprecate it in favor of self-generated internal name
https://github.com/kedacore/keda/blob/main/pkg/scalers/prometheus_scaler.go#L128-L132
The text was updated successfully, but these errors were encountered: