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

Adding support for influx v3 in the influx scaler #5513

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

Conversation

danielwhatmuff
Copy link

  • Implement required functionality to support influx v3
  • Add tests
  • Extend metadata parsing tests with additional data

Fixes #5445
Relates to kedacore/keda-docs#1318

danielwhatmuff and others added 3 commits February 15, 2024 14:15
Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
Signed-off-by: Daniel Whatmuff <danielwhatmuff@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! Could you include an e2e tests for the new version?

Comment on lines +134 to +135
case config.TriggerMetadata["influxVersion"] == "3":
organizationName = val
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? I mean, in this case val is "". If this is intender, I'd prefer to make it explicit

Copy link
Author

Choose a reason for hiding this comment

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

organizations are not used in influx v3 (only databases) so its currently ignored if passed when using that version. Would it be better to use organizationName = "" here to make it more explicit (and keep it ignored) or throw an error if it's passed when using v3 with "organization not supported for Influx v3"?

Copy link
Author

Choose a reason for hiding this comment

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

happy to take any path here, just let me know

pkg/util/certificates.go Outdated Show resolved Hide resolved
@danielwhatmuff
Copy link
Author

danielwhatmuff commented Feb 16, 2024

Something important to note - I do not have an influx v2 deployment available to perform any regression testing for that version. I have verified scaling a deployment using influx v3 though.

@danielwhatmuff
Copy link
Author

Looking good! Could you include an e2e tests for the new version?

I'll take a look at these

Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
@danielwhatmuff
Copy link
Author

Looking good! Could you include an e2e tests for the new version?

I'll take a look at these

This isn't going to be possible as there's no public build for v3 available yet. It will be at some point later this year.

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.

Shall we cover this also in e2e tests? @JorTurFer ?

})

if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

we should not panic here

Copy link
Author

Choose a reason for hiding this comment

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

updated, please let me know if it looks ok

@@ -47,7 +61,29 @@ func NewInfluxDBScaler(config *scalersconfig.ScalerConfig) (Scaler, error) {
return nil, fmt.Errorf("error parsing influxdb metadata: %w", err)
}

logger.Info("starting up influxdb client")
if meta.influxVersion == "3" {
logger.Info("starting up influxdb v3 client")
Copy link
Member

Choose a reason for hiding this comment

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

this would be to verbose, let add V(1) here

Copy link
Author

Choose a reason for hiding this comment

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

updated

}, nil
}

logger.Info("starting up influxdb v2 client")
Copy link
Member

Choose a reason for hiding this comment

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

this would be to verbose, let add V(1) here

Copy link
Author

Choose a reason for hiding this comment

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

updated

Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
Signed-off-by: Daniel Whatmuff <danielwhatmuff@gmail.com>
@JorTurFer
Copy link
Member

Shall we cover this also in e2e tests? @JorTurFer ?

yeah, we should

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.

Any update here?

@jmickey
Copy link

jmickey commented May 16, 2024

@zroubalik @JorTurFer Unfortunately, influxdata have yet to provide public images for influxdb v3. They've claimed this is eventually coming, both to us privately as customers and publicly here: https://www.influxdata.com/blog/the-plan-for-influxdb-3-0-open-source/. I don't think E2E testing is possible until this becomes reality, correct?

If it means anything, we've been running a version of Keda with these changes in production against our commercial Influxdb V3 installation for a while now and it's been stable. Is there a path to get this merged without E2E tests against v3, possibly marking support as experimental, as long as the v2 tests continue to pass?

@JorTurFer
Copy link
Member

If it means anything, we've been running a version of Keda with these changes in production against our commercial Influxdb V3 installation for a while now and it's been stable. Is there a path to get this merged without E2E tests against v3, possibly marking support as experimental, as long as the v2 tests continue to pass?

We shouldn't merge any feature without the proper e2e tests. As the core is already public, can we just build our own image and use it temporally until they release their own one?

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.

Add support for InfluxQL
4 participants