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

Activation threshold (activationValue) for Rabbitmq #2831

Merged
merged 18 commits into from
Aug 3, 2022

Conversation

adborroto
Copy link
Contributor

@adborroto adborroto commented Mar 27, 2022

Signed-off-by: Alejandro Dominguez adborroto90@gmail.com

Adding activation threshold (activationValue) for Rabbitmq. The current activation when scaling from 0 to 1 happens if there is at least 1 message messageCount > 0. If a value for activationValue then the activation occurs if messageCount > activationValue.
The default value for activationValue is 0

Documentation: PR

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • Tests have been added
  • A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Changelog has been updated and is aligned with our changelog requirements

Fixes #

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@adborroto adborroto requested a review from a team as a code owner March 27, 2022 11:06
Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!!
I have left some comments inline.
Apart from them, I'm not totally sure about minMetricValue as a key. I mean, I'd like to have something like activationThreshold, just to be clearer as possible. There are another scalers which use minMetricValue for setting the return value in case of empty response from the upstream.
IMO, we can use this change to unify this value (activationThreshold or similar) in all the scalers, deprecating the current value if the scaler already has another option
WDYT @kedacore/keda-core-contributors ?

Please, also rebase main into your branch 🙏

pkg/scalers/rabbitmq_scaler.go Outdated Show resolved Hide resolved
tests/scalers/rabbitmq-queue-amqp.test.ts Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

zroubalik commented Mar 28, 2022

Thanks for your contribution!! I have left some comments inline. Apart from them, I'm not totally sure about minMetricValue as a key. I mean, I'd like to have something like activationThreshold, just to be clearer as possible. There are another scalers which use minMetricValue for setting the return value in case of empty response from the upstream. IMO, we can use this change to unify this value (activationThreshold or similar) in all the scalers, deprecating the current value if the scaler already has another option WDYT @kedacore/keda-core-contributors ?

+1 exactly my thoughts. We should come up with a proper name first, maybe activation* prefix to the current field that holds the value/queuelength/threshold in each scaler?

@kedacore/keda-core-contributors @adborroto Let's discuss this here: #2800

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@adborroto adborroto changed the title Activation threshold (minMetricValue) for Rabbitmq Activation threshold (activationValue) for Rabbitmq Mar 30, 2022
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

LGTM
only one inline comment

pkg/scalers/rabbitmq_scaler.go Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented Mar 30, 2022

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

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@JorTurFer
Copy link
Member

JorTurFer commented Mar 30, 2022

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

@JorTurFer
Copy link
Member

@adborroto , looks like the added e2e test if failing, could you take a look?

@adborroto
Copy link
Contributor Author

adborroto commented Mar 30, 2022

@adborroto , looks like the added e2e test if failing, could you take a look?

Should be fixed now. Since the job to publish messages was already created no more messages were publish.
I added sh.exec("kubectl delete jobs/rabbitmq-publish-${queueName} --namespace ${namespace}") this should solve the issue.

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@JorTurFer
Copy link
Member

JorTurFer commented Mar 31, 2022

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

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@JorTurFer
Copy link
Member

JorTurFer commented Mar 31, 2022

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

Copy link
Member

@JorTurFer JorTurFer 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!

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.

Generaly looking good, I wonder, shouldn't we check that activationValue >= value ? Would it make sense to allow activationValue < value? 🤔

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@adborroto adborroto requested a review from zroubalik April 8, 2022 14:55
@adborroto
Copy link
Contributor Author

Generaly looking good, I wonder, shouldn't we check that activationValue >= value ? Would it make sense to allow activationValue < value? 🤔

Good catch! I added the verification.

@JorTurFer
Copy link
Member

JorTurFer commented Apr 8, 2022

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

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 for this contribution!

The only thing that's missing is finishing the docs and I think that we are good to merge then.

@adborroto
Copy link
Contributor Author

Hi all, any idea to unlock this one??

@zroubalik
Copy link
Member

@adborroto I think that we should have the general documentation on activation first.

@JorTurFer
Copy link
Member

hey!
The documentation about the behavior is merged.
https://keda.sh/docs/2.8/concepts/scaling-deployments/#activating-and-scaling-thresholds

@zroubalik
Copy link
Member

@adborroto could you please rebase this PR? I think that we are good to merge this one, WDYT @JorTurFer ?

@JorTurFer
Copy link
Member

@adborroto could you please rebase this PR? I think that we are good to merge this one, WDYT @JorTurFer ?

Agree

@JorTurFer
Copy link
Member

one update about this, I have been talking with @adborroto and he will give a try this weekend, if we cannot do it, I will tackle it

# Conflicts:
#	pkg/scalers/rabbitmq_scaler.go
#	pkg/scalers/rabbitmq_scaler_test.go
#	tests/scalers/rabbitmq-helpers.ts
#	tests/scalers/rabbitmq-queue-amqp.test.ts
Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

Looking good, only some nits inline
Thanks! ❤️

CHANGELOG.md Outdated Show resolved Hide resolved
pkg/scalers/rabbitmq_scaler.go Outdated Show resolved Hide resolved
pkg/scalers/rabbitmq_scaler.go Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented Jul 30, 2022

/run-e2e rabbit*
Update: You can check the progress here

Signed-off-by: Alejandro Dominguez <adborroto90@gmail.com>
@JorTurFer
Copy link
Member

JorTurFer commented Jul 30, 2022

/run-e2e rabbit*
Update: You can check the progress here

…mqp_test.go

Signed-off-by: jorturfer <jorge_turrado@hotmail.es>
@JorTurFer JorTurFer force-pushed the feature/minMetricValue_rabbitmq branch from 270b7de to 285728b Compare August 3, 2022 10:11
Signed-off-by: jorturfer <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member

JorTurFer commented Aug 3, 2022

/run-e2e rabbit*
Update: You can check the progress here

Signed-off-by: jorturfer <jorge_turrado@hotmail.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants