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

Add query parameters in prometheus scaler #4957

Merged

Conversation

HenriquePiccolo
Copy link
Contributor

@HenriquePiccolo HenriquePiccolo commented Sep 8, 2023

Signed-off-by: Henrique Piccolo henriquepiccolo@hotmail.com.br

Add query parameters in prometheus scaler

Checklist

Relates to #1218

Fixes #4962

@HenriquePiccolo HenriquePiccolo requested a review from a team as a code owner September 8, 2023 18:36
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

Learn more about:

Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
CHANGELOG.md Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member

What would you like to achieve adding extra info to the query string?

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.

Could you please add issue that explains the reason for this feature?

@HenriquePiccolo
Copy link
Contributor Author

Here's the issue #4962

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.

Can't this be done just with the custom headers? I mean, isn't them enough for setting the tenant and those stuff?

Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
@HenriquePiccolo
Copy link
Contributor Author

@JorTurFer

Yes, we are aware of the custom headers and we use them to specify wich tenant keda just must reach.

But, just to give you some context, we are using thanos as our long term storage tsdb with a setup of hundreds of tenants, and within that, there are different versions of this solution, so it is there that query parameters are necessary, they are used to specify the version of our solution that we want to query.

pkg/scalers/prometheus_scaler_test.go Outdated Show resolved Hide resolved
pkg/scalers/prometheus_scaler.go Outdated Show resolved Hide resolved
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.

@HenriquePiccolo any update on this please? We are going to cut the release tomorrow.

Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
@HenriquePiccolo
Copy link
Contributor Author

@zroubalik @JorTurFer

I updated the scaler test to validate prometheusQuery.

Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
@axelsccp axelsccp force-pushed the add-query-parameter-prometheus branch 2 times, most recently from 106a903 to 398d13d Compare October 9, 2023 19:36
@axelsccp axelsccp force-pushed the add-query-parameter-prometheus branch from dd9bb63 to c253cdf Compare October 9, 2023 19:44
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
@axelsccp
Copy link
Contributor

axelsccp commented Oct 9, 2023

Hey @JorTurFer @zroubalik we've attended your sugestions and implemented the required tests and modifications, could you verify, please?

CHANGELOG.md Outdated Show resolved Hide resolved
pkg/scalers/prometheus_scaler.go Show resolved Hide resolved
@axelsccp axelsccp force-pushed the add-query-parameter-prometheus branch from 5d56c79 to 2fba509 Compare October 10, 2023 13:48
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
@zroubalik
Copy link
Member

zroubalik commented Oct 10, 2023

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

@zroubalik zroubalik merged commit 853fc61 into kedacore:main Oct 10, 2023
18 of 19 checks passed
toniiiik pushed a commit to toniiiik/keda that referenced this pull request Jan 15, 2024
Signed-off-by: Henrique Piccolo <henriquepiccolo@hotmail.com.br>
Signed-off-by: Axel Paschoa <apaschoabarres@gmail.com>
Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Co-authored-by: Axel Paschoa <apaschoabarres@gmail.com>
Signed-off-by: anton.lysina <alysina@gmail.com>
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 queryParameters in prometheus-scaler
4 participants