-
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
Add support for scaling by Google Pub/Sub subscription publish rate #5070
Comments
Hello! |
Hey, I'm interested in taking on this feature! |
I see that there's already But please let me know if you have any additional pointer, thank you! |
Thanks @kevinmingtarja, yeah, that is a good starting point. Here are docs for contributing a new scaler, you might find something valuable there. |
Got it, thanks for the pointers! I'll get started soon. |
Hi @zroubalik @JorTurFer, I did a bit of reading and have a question regarding how we should approach this. Right now for the GCP Pub/Sub scaler, the level of granularity is But the proposal here is to use the metric topic/message_sizes, which is a different level of granularity than With this in mind, I think there are two options at least:
I'm kind of leaning towards option (1), since the API change is very limited and non-breaking, so by default it's backwards compatible as well. But I wanted to get a second opinion before starting to code. Thank you! |
I also think that the option 1 is the best if it's not a breaking change |
Got it, thanks for the input Jorge |
I agree with that, thanks for the investigation. |
After starting to code, I think I realized the current code assumes that the metric/mode is a single value, and doesn't handle the case if it's a distribution [1], like for topic/message_sizes. The main difference I can see is that for distribution, we need to specify an aggregation like sum, mean, p99, etc (example below) in order to get a single value. So I'll address this as well in my changes. References: |
Hi @mbrancato, just a heads up, once the PR for this gets in on the next release, you will be able to do what you proposed with the following params with the GCP PubSub scaler!
|
Proposal
Scaling by unacknowledged messages and oldest message are good, reactive scaling metrics. If a queue is behind, both of these are good for responding to how much is currently in the queue. They are, however, reactive and likely can lead to constant scaling up and down to keep up with consistent message volumes.
It would be nice if there was a trigger based on the rate of incoming messages (
pubsub.googleapis.com/topic/message_sizes
) to keep up with current rate, and use a reactive metric like unacknowledged messages to scale up when things get behind.Scaler Source
Google Pub/Sub incoming messages
Scaling Mechanics
Scale based on metric
Authentication Source
GCP
Anything else?
No response
The text was updated successfully, but these errors were encountered: