add DeliverGetRate, PublishedToDeliveredRatio and ExpectedQueueConsumptionTime trigger modes to RabbitMQ scaler#6933
Conversation
…bitMQ scaler Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
…to the user Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
|
Could you add some e2e tests under /test/rabbitmq? |
Will do, once I'll get a hold on some free time. BTW it seems that I'll have to slightly extend |
|
Currently, there is no contribution guide, but we plan to add one soon. The Docker image is written in Go and is designed to be simple and easy to use. https://github.com/kedacore/test-tools/tree/main/e2e/images/rabbitmq |
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
4159be7 to
4a39cb6
Compare
zroubalik
left a comment
There was a problem hiding this comment.
Thanks a lot for the contribution, this is really great. A couple of nits from my side:
- e2e test would be really great to have
- please create a new issue with the problem description and refrence in the changelog
- in the documentation PR could you please add a new paragraph with an explanation of all trigger modes we have, ie when to use what - it doesn't have to be super complex, but something along the description you put here in the PR, see the comment there: https://github.com/kedacore/keda-docs/pull/1601/files#r2300363424
… interval - add E2E tests for DeliverGetRate, PublishedToDeliveredRatio and ExpectedQueueConsumptionTime trigger modes Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
- updated some output messages Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
|
Semgrep found 6
Semgrep found a possible database connection string built with string concatenation. Check for proper encoding/escaping of components to prevent parse errors and injection vulnerabilities. |
E2E tests have been added. Note however, that they'll work only with updated
Done (#7071).
Done. |
…ght previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
…ght previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu>
There was a problem hiding this comment.
Pull Request Overview
This PR adds three new trigger modes to the RabbitMQ scaler: DeliverGetRate, PublishedToDeliveredRatio, and ExpectedQueueConsumptionTime. These new modes provide more granular scaling capabilities based on message delivery rates and queue consumption patterns.
- Updates RabbitMQ scaler to support delivery rate monitoring and ratio-based scaling
- Adds comprehensive test coverage for the new trigger modes with dedicated test files
- Improves error messages and code maintainability throughout the scaler implementation
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/scalers/rabbitmq_scaler.go | Core implementation of new trigger modes and updated scaler logic |
| pkg/scalers/rabbitmq_scaler_test.go | Updated unit tests with new trigger mode test data |
| tests/scalers/rabbitmq/rabbitmq_helper.go | Enhanced helper functions for message publishing/consuming with rate control |
| tests/scalers/rabbitmq/rabbitmq_queue_http_*_test.go | Integration tests for each new trigger mode |
| CHANGELOG.md | Documentation of the new feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
/run-e2e rabbit |
|
/run-e2e rabbit |
|
tests timeout when setting up strimzi maybe related to #6929? |
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
|
/run-e2e rabbit |
|
all tests passed, lgtm |
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
|
/run-e2e rabbit |
|
@zroubalik, @wozniakjan, |
|
Thanks for the heads up, I think that my colleagues missed the docs part, sorry :( Could you rebase docs and apply the change also to v2.19? |
…ptionTime trigger modes to RabbitMQ scaler (kedacore#6933) * add DeliverGetRate and PublishedToDeliveredRatio trigger modes to RabbitMQ scaler Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changelog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changlog entry updated Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fix invalid mode in e2e tests Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * report complete list of available trigger modes when returning error to the user Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * move description in changelog to improvements section Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - RMQPublishMessages(): add support for constant messages publication interval - add E2E tests for DeliverGetRate, PublishedToDeliveredRatio and ExpectedQueueConsumptionTime trigger modes Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - add ExpectedQueueConsumptionTime trigger mode to RabbitMQ scaler - updated some output messages Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * ChangeLog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * apply static checks recommendations Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * missing fixes to errors reported by static checks Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed error expected messages in TestRabbitMQAnonymizeRabbitMQError Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> --------- Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com> Signed-off-by: Dmitriy Altuhov <altuhovd@gmail.com>
…ptionTime trigger modes to RabbitMQ scaler (kedacore#6933) * add DeliverGetRate and PublishedToDeliveredRatio trigger modes to RabbitMQ scaler Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changelog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changlog entry updated Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fix invalid mode in e2e tests Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * report complete list of available trigger modes when returning error to the user Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * move description in changelog to improvements section Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - RMQPublishMessages(): add support for constant messages publication interval - add E2E tests for DeliverGetRate, PublishedToDeliveredRatio and ExpectedQueueConsumptionTime trigger modes Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - add ExpectedQueueConsumptionTime trigger mode to RabbitMQ scaler - updated some output messages Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * ChangeLog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * apply static checks recommendations Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * missing fixes to errors reported by static checks Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed error expected messages in TestRabbitMQAnonymizeRabbitMQError Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> --------- Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
…ptionTime trigger modes to RabbitMQ scaler (kedacore#6933) * add DeliverGetRate and PublishedToDeliveredRatio trigger modes to RabbitMQ scaler Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changelog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * changlog entry updated Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fix invalid mode in e2e tests Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * report complete list of available trigger modes when returning error to the user Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * move description in changelog to improvements section Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - RMQPublishMessages(): add support for constant messages publication interval - add E2E tests for DeliverGetRate, PublishedToDeliveredRatio and ExpectedQueueConsumptionTime trigger modes Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * - add ExpectedQueueConsumptionTime trigger mode to RabbitMQ scaler - updated some output messages Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * ChangeLog update Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed missing interval argument in RMQPublishMessages() calls not caught previously in bulk substitution Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * apply static checks recommendations Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * missing fixes to errors reported by static checks Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> * fixed error expected messages in TestRabbitMQAnonymizeRabbitMQError Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> --------- Signed-off-by: Wojciech Moczulski <wojciech.moczulski@stormlabs.eu> Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com> Co-authored-by: Jan Wozniak <wozniak.jan@gmail.com>
Introduced three additional trigger modes for RabbitMQ scaler, as proposed in #7071:
DeliverGetRate, which will activate, when given messages delivery rate will be reachedPublishedToDeliveredRatio, which will activate, when scaler hits certain level of published to delivered messages ratioExpectedQueueConsumptionTime, which will be activated when the total estimated waiting time for delivery of all messages available in the queue at a given moment (with the current capacity of consumers) reaches the indicated value.Checklist
Documentation update: kedacore/keda-docs#1601
Additional references: