Skip to content

Commit

Permalink
promethues_scler: add url in error information
Browse files Browse the repository at this point in the history
Without the query its hard to debug which query is causing the error when
there are hundreds of scalers.

Signed-off-by: Suresh Kumar <[email protected]>
  • Loading branch information
Suresh Kumar Ponnusamy committed Jul 20, 2022
1 parent 34fc864 commit 8b04e24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md
- **AWS SQS Queue Scaler:** Support for scaling to include in-flight messages. ([#3133](https://github.com/kedacore/keda/issues/3133))
- **GCP Stackdriver Scaler:** Added aggregation parameters ([#3008](https://github.com/kedacore/keda/issues/3008))
- **Prometheus Scaler:** Add ignoreNullValues to return error when prometheus return null in values ([#3065](https://github.com/kedacore/keda/issues/3065))
- **Prometheus Scaler:** Improve error reporting, include the failed query in error message ([#3406](https://github.com/kedacore/keda/pull/3406))
- **Selenium Grid Scaler:** Edge active sessions not being properly counted ([#2709](https://github.com/kedacore/keda/issues/2709))
- **Selenium Grid Scaler:** Max Sessions implementation issue ([#3061](https://github.com/kedacore/keda/issues/3061))
### Fixes
Expand Down
2 changes: 1 addition & 1 deletion pkg/scalers/prometheus_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (s *prometheusScaler) ExecutePromQuery(ctx context.Context) (float64, error
_ = r.Body.Close()

if !(r.StatusCode >= 200 && r.StatusCode <= 299) {
return -1, fmt.Errorf("prometheus query api returned error. status: %d response: %s", r.StatusCode, string(b))
return -1, fmt.Errorf("prometheus query api returned error. status: %d response: %s url: %s", r.StatusCode, string(b), url)
}

var result promQueryResult
Expand Down

0 comments on commit 8b04e24

Please sign in to comment.