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

fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength #3046

Merged
merged 15 commits into from
May 26, 2022

Conversation

JorTurFer
Copy link
Member

@JorTurFer JorTurFer commented May 13, 2022

Signed-off-by: Jorge Turrado [email protected]

After introducing the unique metric names using the prefix and the solution for external scaler, it fails in case of ScaledJobs because we use queueLength as a metric name in case of ScaledJob (ignoring the given name from the external scaler) and this metric doesn't have the prefix.

This PR modifies the behaviour to use the metric spec given from GetMetricSpec instead of the hardcoded value, Using this approach all the code in the scaler that work for ScaledObject work for ScaledJob because now they follow the same behavior (from scaler internal pov).

I have added also an e2e with ScaledJob and external scaler to ensure the behaviour in the future and other small improvements

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • Changelog has been updated and is aligned with our changelog requirements

Fixes # #3032

@JorTurFer
Copy link
Member Author

JorTurFer commented May 13, 2022

/run-e2e external*
Update: You can check the progres here

Signed-off-by: Jorge Turrado <[email protected]>
@JorTurFer JorTurFer changed the title wip - create e2e test to check the fail wip - fix: use metic name with prefix in scaledjobs May 13, 2022
@JorTurFer
Copy link
Member Author

JorTurFer commented May 13, 2022

/run-e2e external*
Update: You can check the progres here

JorTurFer added 2 commits May 14, 2022 00:36
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
@JorTurFer
Copy link
Member Author

JorTurFer commented May 13, 2022

/run-e2e external*
Update: You can check the progres here

@JorTurFer JorTurFer changed the title wip - fix: use metic name with prefix in scaledjobs wip - fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength May 13, 2022
JorTurFer added 3 commits May 14, 2022 01:06
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
@JorTurFer
Copy link
Member Author

JorTurFer commented May 13, 2022

/run-e2e external*
Update: You can check the progres here

@JorTurFer JorTurFer changed the title wip - fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength May 13, 2022
@JorTurFer JorTurFer marked this pull request as ready for review May 13, 2022 23:51
@JorTurFer JorTurFer requested a review from a team as a code owner May 13, 2022 23:51
@JorTurFer
Copy link
Member Author

JorTurFer commented May 13, 2022

/run-e2e
Update: You can check the progres here

Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
@JorTurFer
Copy link
Member Author

JorTurFer commented May 14, 2022

/run-e2e
Update: You can check the progres here

@JorTurFer
Copy link
Member Author

JorTurFer commented May 14, 2022

/run-e2e
Update: You can check the progres here

CHANGELOG.md Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member Author

BTW, @zroubalik and/or @ahmelsayed , I'd like to have your review too

@JorTurFer JorTurFer requested review from zroubalik and ahmelsayed May 16, 2022 07:14
Signed-off-by: Jorge Turrado <[email protected]>
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@zroubalik
Copy link
Member

zroubalik commented May 24, 2022

/run-e2e
Update: You can check the progres here

@JorTurFer JorTurFer added arm and removed arm labels May 24, 2022
@JorTurFer
Copy link
Member Author

JorTurFer commented May 26, 2022

/run-e2e
Update: You can check the progres here

@JorTurFer
Copy link
Member Author

I'd say that the fail was because of race conditions due to running the "main" branch e2e tests at the same time.
I have retriggered them and if you agree, I'll merge this once e2e tests pass @zroubalik

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JorTurFer JorTurFer changed the title fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength fix: use metricName from GetMetricsSpec in ScaledJobs instead of queueLength May 26, 2022
@JorTurFer JorTurFer merged commit 26edd4f into kedacore:main May 26, 2022
@JorTurFer JorTurFer deleted the external-job branch May 26, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants