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

metricName shouldn't be required and should be deprecated for all the scalers #4220

Closed
4 of 5 tasks
JorTurFer opened this issue Feb 9, 2023 · 19 comments
Closed
4 of 5 tasks
Assignees

Comments

@JorTurFer
Copy link
Member

JorTurFer commented Feb 9, 2023

Proposal

Currently, some scalers require 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 favour of self-generated internal name

Scalers:

  • aws-cloudwatch - metric name is needed for this one
  • azure-log-analytics
  • azure-monitor
  • azure-storage-blob
  • cassandra
  • couchdb - just lefover in the code, doesn't have to be included in the docs and deprecations
  • graphite
  • huawei-cloudeye - metric name is needed for this one
  • influxdb
  • mongodb
  • mssql
  • postgresql
  • prometheus
  • rabbitmq-queue

TODO list

@JorTurFer JorTurFer added needs-discussion feature-request All issues for new features that have not been committed to labels Feb 9, 2023
@JorTurFer
Copy link
Member Author

@kedacore/keda-core-contributors , do you agree with this?

@zroubalik
Copy link
Member

Agree, this should be done for all scalers, not just Prometheus.

@zroubalik
Copy link
Member

@JorTurFer could you please identify those scalers and create a separate issues for them? And give them good first issues/help wanted labels? As these could be ideal issues for newcomers.

@JorTurFer
Copy link
Member Author

JorTurFer commented Feb 10, 2023

Yeah, I will do a round checking all the scalers.
I rename this issue with a generic title to track the new issues I'll create

@JorTurFer JorTurFer self-assigned this Feb 10, 2023
@JorTurFer JorTurFer changed the title Prometheus Scaler: metricName shouldn't be required and should be deprecated metricName shouldn't be required and should be deprecated for all the scalers Feb 10, 2023
@JorTurFer
Copy link
Member Author

I have found 4 scalers where this happens. I have created an issue for each one and update this issue to track them

@JorTurFer JorTurFer removed their assignment Feb 12, 2023
@dttung2905
Copy link
Contributor

@JorTurFer I could help with 1 or 2. If you can do 1 first as an example, I could look at it and see what are needed to be changed 🙏

@JorTurFer
Copy link
Member Author

@JorTurFer I could help with 1 or 2. If you can do 1 first as an example, I could look at it and see what are needed to be changed 🙏

Sure, I will do one of them this week (I have a trip today and I'll be outside until Wednesday night)

@zroubalik
Copy link
Member

zroubalik commented Feb 13, 2023

What should be done:

anything else @kedacore/keda-core-contributors ?

@JorTurFer
Copy link
Member Author

JorTurFer commented Feb 13, 2023

That's the process!
I'll keep all the issues for newcomers :)

@yardenshoham
Copy link
Contributor

yardenshoham commented Feb 13, 2023

Some more scalers to add to the task list (based on searching metricName in v2.10 docs):

  • aws-cloudwatch
  • azure-log-analytics
  • azure-monitor
  • azure-storage-blob
  • huawei-cloudeye
  • influxdb
  • mongodb
  • mssql
  • postgresql
  • rabbitmq-queue

@tomkerkhove
Copy link
Member

@OsamaNabih More on that in our deprecation policy - https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md

@JorTurFer
Copy link
Member Author

Some more scalers to add to the task list (based on searching metricName in v2.10 docs):

  • aws-cloudwatch
  • azure-log-analytics
  • azure-monitor
  • azure-storage-blob
  • huawei-cloudeye
  • influxdb
  • mongodb
  • mssql
  • postgresql
  • rabbitmq-queue

Be careful, in that list there are some scalers which really need metricName, for exampleaws-cloudwatch scaler needs the value for the upstream, we need to check if they really need the value or it's only used for the internal metric name

@yardenshoham
Copy link
Contributor

@JorTurFer

#4235 will complete the tasks "code change to print warning message with deprecation notice" and "update deprecation notice in the Changelog".

kedacore/keda-docs#1074 will complete "update documentation to specify deprecation notice...".

@yardenshoham
Copy link
Contributor

I was hoping to complete this today by opening a discussion but I don't have permissions to open a deprecation category discussion

@JorTurFer
Copy link
Member Author

Should we create the discussion now or maybe as part of the release @kedacore/keda-core-contributors ? I guess that we should open it during the release, because maybe the new way of doing the things isn't release yet (not in this specific case)

@stale
Copy link

stale bot commented Apr 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Apr 26, 2023
@yardenshoham
Copy link
Contributor

I think this is done

@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Apr 27, 2023
@dttung2905
Copy link
Contributor

Hello @JorTurFer, just want to double check whether we still need to deprecate azure-monitor scaler? I see this scaler in the list you mention at the start of this PR but so far I don't see the FIXME tag in azure-monitor code like

Name: GenerateMetricNameWithIndex(s.metadata.scalerIndex, kedautil.NormalizeString(fmt.Sprintf("azure-monitor-%s", s.metadata.azureMonitorInfo.Name))),

However, I don't see any default option to use internally if metricName is not specified in trigger metadata though. Is this field metricName still needed ?
if val, ok := config.TriggerMetadata[azureMonitorMetricName]; ok && val != "" {
meta.azureMonitorInfo.Name = val
} else {
return nil, fmt.Errorf("no metricName given")
}

If it is still needed, I can make changes together in this PR too #4806

@JorTurFer
Copy link
Member Author

Nice catch @dttung2905
I have checked the code, and azure_monitor scaler uses metricName for the request, so it's correctly added in the scaler and we don't have to remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants