From 58df80e542201b91e480c3425ecce6dcd792c1d3 Mon Sep 17 00:00:00 2001 From: owensmallwood Date: Thu, 30 Jan 2025 18:29:51 -0600 Subject: [PATCH] Unified Storage: Fix panic from log (#99850) evt.Object can be nil, so use the key instead --- pkg/storage/unified/resource/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/unified/resource/search.go b/pkg/storage/unified/resource/search.go index c7aa0c5d03a..6d03f97e6f2 100644 --- a/pkg/storage/unified/resource/search.go +++ b/pkg/storage/unified/resource/search.go @@ -461,7 +461,7 @@ func (s *searchSupport) handleEvent(ctx context.Context, evt *WrittenEvent) { latencySeconds := float64(time.Now().UnixMicro()-evt.ResourceVersion) / 1e6 span.AddEvent("index latency", trace.WithAttributes(attribute.Float64("latency_seconds", latencySeconds))) if latencySeconds > 5 { - s.log.Debug("high index latency object details", "resource", evt.Key.Resource, "latency_seconds", latencySeconds, "name", evt.Object.GetName(), "namespace", evt.Object.GetNamespace(), "uid", evt.Object.GetUID()) + s.log.Debug("high index latency object details", "resource", evt.Key.Resource, "latency_seconds", latencySeconds, "name", evt.Key.Name, "namespace", evt.Key.Namespace) s.log.Warn("high index latency", "latency", latencySeconds) } if IndexMetrics != nil {