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

prometheus scaler: handle errors from Prometheus server #1497

Merged
merged 2 commits into from
Jan 12, 2021

Conversation

surki
Copy link
Contributor

@surki surki commented Jan 11, 2021

Signed-off-by: Suresh Kumar sureshkumar.pp@gmail.com

When there is a typo or some other error in prometheus query, prometheus server returns
non-2xx response, which is being ignored silently. This checks for response
code and returns appropriate error

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)
  • Tests have been added
  • A PR is opened to update the documentation on https://github.com/kedacore/keda-docs
  • Changelog has been updated

When there is a typo or some other error in query, prometheus server returns
non-2xx response, which is being ignored silently. This checks for response
code and returns appropriate error

Signed-off-by: Suresh Kumar <sureshkumar.pp@gmail.com>
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.

Looking good, minor question.

pkg/scalers/prometheus_scaler.go Show resolved Hide resolved
@zroubalik
Copy link
Member

@surki would you mind adding this to the Changelog (Improvements section)?

Signed-off-by: Suresh Kumar <sureshkumar.pp@gmail.com>
@surki surki force-pushed the prometheus-scaler-log-errors branch from 7ebe6d7 to 01abfbc Compare January 11, 2021 14:18
@surki
Copy link
Contributor Author

surki commented Jan 11, 2021

@surki would you mind adding this to the Changelog (Improvements section)?

Done, thanks.

@ahmelsayed ahmelsayed merged commit c09a1e3 into kedacore:main Jan 12, 2021
@ahmelsayed
Copy link
Contributor

Thanks @surki for your contribution

ycabrer pushed a commit to ycabrer/keda that referenced this pull request Mar 1, 2021
* prometheus scaler: handle errors from Prometheus server

When there is a typo or some other error in query, prometheus server returns
non-2xx response, which is being ignored silently. This checks for response
code and returns appropriate error

Signed-off-by: Suresh Kumar <sureshkumar.pp@gmail.com>

* Update changelog

Signed-off-by: Suresh Kumar <sureshkumar.pp@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.

4 participants