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

Allow reporting the float value from external scaler #6482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jkremser
Copy link
Contributor

@jkremser jkremser commented Jan 13, 2025

Some external scalers may have report metric as a float instead of int. For example imagine a rate function.

Fixes: #5159

@zroubalik
Copy link
Member

zroubalik commented Jan 13, 2025

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

@zroubalik
Copy link
Member

zroubalik commented Jan 13, 2025

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

Signed-off-by: Jirka Kremser <[email protected]>
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.

I like this idea, but I think that this change breaks the protobuffer contract (and it's the reason behind the failing e2e).
I'm not an expert in gRPC so maybe I'm missing some important point, but I've found this page -> https://protobuf.dev/getting-started/pythontutorial/#extending-a-protobuf

Sooner or later after you release the code that uses your protocol buffer, you will undoubtedly want to “improve” the protocol buffer’s definition. If you want your new buffers to be backwards-compatible, and your old buffers to be forward-compatible – and you almost certainly do want this – then there are some rules you need to follow. In the new version of the protocol buffer:

  • you must not change the tag numbers of any existing fields.
  • you must not add or delete any required fields.
  • you may delete optional or repeated fields.
  • you may add new optional or repeated fields but you must use fresh tag numbers (that is, tag numbers that were never used in this protocol buffer, not even by deleted fields).

I think that we have to make the new proto field as optional in order to not break the contract.

Another thing that comes to my mind, as the metric value can be float, does it make sense to support floats also for targetSize?

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

Successfully merging this pull request may close these issues.

Support for Returning Float Values in GetMetrics for External Scalers
3 participants