-
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
[InfluxDB Scaler] Allow queries that return integers in addition to those that return floats #1973
Comments
Seems like a fair requests, I don't think there is something that prevents us in using int there as well. @yquansah wdyt? @philomory Are you willing to contribute this one? |
@zroubalik I mean it eventually does get truncated to an integer keda/pkg/scalers/influxdb_scaler.go Line 193 in 03d0f98
but there is some assumptions being made here. Is there a particular error or something you are encountering? @philomory |
@zroubalik Yes, I think I'd be able to contribute a fix. At the very least, I can give it a shot. @yquansah Yes, if you start with a query that returns an integer the entire process fails, while logging the error "value could not be parsed into a float". For example, if I try to use the following query:
... this will return the number of jobs in a backlog, which is an integer. Used as-is, this causes the scaler to fail; if I want it to work, I have to manually convert my data to floats within my query, e.g.:
|
@philomory Got you. Okay this should be something I can write a fix for |
Proposal
The InfluxDB scaler should continue to function if the query used returns an integer rather than a float. At the moment, there is an undocumented requirement that queries must return floats.
Use-Case
I'd like to query values from InfluxDB that happen to be stored as integers (event counters and such) without having to remember to manually convert those values to floats in each Flux query.
Anything else?
influxdb_scaler.go lines 173 to 176 contains the following code:
It seems like adding an additional branch that handles integers wouldn't be a huge burden.
The text was updated successfully, but these errors were encountered: