Skip to content

Commit

Permalink
Use argument name to scaledResource for clarification
Browse files Browse the repository at this point in the history
Signed-off-by: Yoon Park <[email protected]>
  • Loading branch information
yoongon committed Aug 29, 2023
1 parent cd2851b commit e81654a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/prommetrics/prommetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ func RecordScalerActive(namespace string, scaledResource string, scaler string,
}

// RecordScalerError counts the number of errors occurred in trying to get an external metric used by the HPA
func RecordScalerError(namespace string, scaledObject string, scaler string, scalerIndex int, metric string, isScaledObject bool, err error) {
func RecordScalerError(namespace string, scaledResource string, scaler string, scalerIndex int, metric string, isScaledObject bool, err error) {
if err != nil {
scalerErrors.With(getLabels(namespace, scaledObject, scaler, scalerIndex, metric, getResourceType(isScaledObject))).Inc()
scalerErrors.With(getLabels(namespace, scaledResource, scaler, scalerIndex, metric, getResourceType(isScaledObject))).Inc()
if isScaledObject {
RecordScaledObjectError(namespace, scaledObject, err)
RecordScaledObjectError(namespace, scaledResource, err)
} else {
RecordScaledJobError(namespace, scaledObject, err)
RecordScaledJobError(namespace, scaledResource, err)
}
scalerErrorsTotal.With(prometheus.Labels{}).Inc()
return
}
// initialize metric with 0 if not already set
_, errscaler := scalerErrors.GetMetricWith(getLabels(namespace, scaledObject, scaler, scalerIndex, metric, getResourceType(isScaledObject)))
_, errscaler := scalerErrors.GetMetricWith(getLabels(namespace, scaledResource, scaler, scalerIndex, metric, getResourceType(isScaledObject)))
if errscaler != nil {
log.Error(errscaler, "Unable to write to metrics to Prometheus Server: %v")
}
Expand Down

0 comments on commit e81654a

Please sign in to comment.