diff --git a/pkg/prommetrics/prommetrics.go b/pkg/prommetrics/prommetrics.go index 4f7400599bd..717ff3d6144 100644 --- a/pkg/prommetrics/prommetrics.go +++ b/pkg/prommetrics/prommetrics.go @@ -149,6 +149,7 @@ func init() { metrics.Registry.MustRegister(scalerActive) metrics.Registry.MustRegister(scalerErrors) metrics.Registry.MustRegister(scaledObjectErrors) + metrics.Registry.MustRegister(scaledJobErrors) metrics.Registry.MustRegister(triggerTotalsGaugeVec) metrics.Registry.MustRegister(crdTotalsGaugeVec) @@ -224,7 +225,7 @@ func RecordScaledJobError(namespace string, scaledJob string, err error) { return } // initialize metric with 0 if not already set - _, errscaledjob := scaledObjectErrors.GetMetricWith(labels) + _, errscaledjob := scaledJobErrors.GetMetricWith(labels) if errscaledjob != nil { log.Error(err, "Unable to write to metrics to Prometheus Server: %v") return diff --git a/pkg/scaling/scale_handler_test.go b/pkg/scaling/scale_handler_test.go index b10a8dab183..6fbc5196a30 100644 --- a/pkg/scaling/scale_handler_test.go +++ b/pkg/scaling/scale_handler_test.go @@ -285,7 +285,7 @@ func TestCheckScaledObjectScalersWithError(t *testing.T) { assert.Equal(t, true, isError) } -func TestCheckScaledObjectFindFirstActiveNotIgnoreOthers(t *testing.T) { +func TestCheckvaObjectFindFirstActiveNotIgnoreOthers(t *testing.T) { ctrl := gomock.NewController(t) mockClient := mock_client.NewMockClient(ctrl) mockExecutor := mock_executor.NewMockScaleExecutor(ctrl)