Skip to content

Commit 81ee1e6

Browse files
Add trace log to podmetrics and small warning fix to metrics_spec_test.
1 parent c082e86 commit 81ee1e6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/epp/backend/metrics/metrics_spec_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func TestStringToMetricSpec(t *testing.T) {
159159
}
160160
} else {
161161
if got == nil {
162-
t.Errorf("stringToMetricSpec() = got nil but wanted %v", tt.want)
162+
t.Fatalf("stringToMetricSpec() = got nil but wanted %v", tt.want)
163163
}
164164
if !reflect.DeepEqual(got.MetricName, tt.want.MetricName) {
165165
t.Errorf("stringToMetricSpec() got MetricName = %v, want %v", got.MetricName, tt.want.MetricName)

pkg/epp/backend/metrics/pod_metrics.go

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (pm *podMetrics) refreshMetrics() error {
115115
defer cancel()
116116
updated, err := pm.pmc.FetchMetrics(ctx, pm.GetPod(), pm.GetMetrics(), pool.Spec.TargetPortNumber)
117117
if err != nil {
118+
pm.logger.V(logutil.TRACE).Info("Failed to refreshed metrics:", "err", err)
118119
// As refresher is running in the background, it's possible that the pod is deleted but
119120
// the refresh goroutine doesn't read the done channel yet. In this case, we just return nil.
120121
// The refresher will be stopped after this interval.

0 commit comments

Comments
 (0)